Menu

Include Using Namespace Std Int Main Double Price 0 Total 0 Sum 0 Cout Enter 99 Exit Progr Q43798130

break; - (4 marks) final cliff between sentinel y louter centolled loop Using a sentinel-controlled while loop, ask the user

#include <iostream>

using namespace std;

int main ()
{
double price=0, total=0, sum=0;

cout << “**Enter -99 to exit program**n”;

while (price != -99)
{
cout << “Enter the first item’s price : RM “;
cin >> price;
cout << “Enter the next item’s price : RM “;
cin >> price;
}

sum += price;
total = 99-sum;

cout << “The total price is RM ” << total;

return 0;
}
  

break; – (4 marks) final cliff between sentinel y louter centolled loop Using a sentinel-controlled while loop, ask the user to input the price for items, calculate the total of prices and display the output as follows. **Enter -99 to exit program** Enter first item’s price : RM 22.50 Enter next item’s price : RM 25.50 Enter next item’s price : RM 21.20 Enter next item’s price : RM –99 The total price is RM 69.2 (5 marks) RM ” lak Cipta Universiti Teknologi MARA CONFIDENTIAL cout <a “Renter forst it’s puce com once ; while (puce !=-99) [cent Le “hith next it’s nice Rm “; tutul ts puce tehno; Show transcribed image text break; – (4 marks) final cliff between sentinel y louter centolled loop Using a sentinel-controlled while loop, ask the user to input the price for items, calculate the total of prices and display the output as follows. **Enter -99 to exit program** Enter first item’s price : RM 22.50 Enter next item’s price : RM 25.50 Enter next item’s price : RM 21.20 Enter next item’s price : RM –99 The total price is RM 69.2 (5 marks) RM ” lak Cipta Universiti Teknologi MARA CONFIDENTIAL cout

Expert Answer


Answer to #include using namespace std; int main () { double price=0, total=0, sum=0; cout price; cout > price; } sum += price; t…

OR