Skip to content
Snippets Groups Projects
Commit 9d2e2ff6 authored by Rudi Buss's avatar Rudi Buss
Browse files

Update Solution Exercise 1 - Farm.cpp

parent 8a0b9118
No related branches found
No related tags found
No related merge requests found
#include<iostream>
#include <iostream>
using namespace std;
int weight = 0; // Declaration and initialization of 3 global variables
int weight = 0; // Declaration and initialization of 3 global variables
float dailyPrice = 0;
float revenue = 0;
void Data_query() //Declaration and definition of the function Data_query
void Data_query() // Declaration and definition of the function Data_query
{
cout << "What is the weight? " << endl;
cin >> weight;
cout << "What is the daily price? " << endl;
cin >> dailyPrice;
cout << "What is the weight? " << endl;
cin >> weight;
cout << "What is the daily price? " << endl;
cin >> dailyPrice;
}
void Calculate_revenue() //Declaration and definition of the function Calcuate_revenue
void Calculate_revenue() // Declaration and definition of the function Calcuate_revenue
{
revenue = weight * dailyPrice;
cout << "Revenue: " << revenue <<endl;
revenue = weight * dailyPrice;
cout << "Revenue: " << revenue << endl;
}
int main()
{
//Calling the functions
Data_query();
Calculate_revenue();
int main() {
// Calling the functions
Data_query();
Calculate_revenue();
cout << endl << endl;
return 0;
}
cout << endl << endl;
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment