Skip to content
Snippets Groups Projects

Update Exercise 2 - Farm.txt

Closed Omkar Akolkar requested to merge oa07987/vhb-cpp-en:oa07987-main-patch-95536 into main
1 file
+ 18
0
Compare changes
  • Side-by-side
  • Inline
@@ -11,3 +11,21 @@ Both variables are to be entered in a dialog with the user via the console.
The revenue is then calculated from weight * daily price.
Print the revenue on the screen.
#inlcude <iostream>
using namespace std;
int main()
{
float weight;
float dailyprice;
float revenue;
cout << "Revenue for the Pig Sales; " << endl;
cout << "Weight: " << endl;
cin >> weight;
cout << "DailyPrice: " << endl;
cin >> dailyprice;
revenue = weight * dailyprice;
cout << " Revenue for the pig = " << revenue << endl;
}
\ No newline at end of file
Loading