1. Engineering
  2. Computer Science
  3. convert the following java code into c this is what...

Question: convert the following java code into c this is what...

Question details

Convert the following Java code into C++

1 import java.util.Scanner; 3 public class BillPay public static void main( String[] args )I Scanner input- new Scanner( System.in ); 6 7 PIZZA-PRICE= 10, BURGER_PRICE 7, SUSHIPRICE = 5, MOVIETICKET-PRICE = 12; final int 9 10 - - final double TIP PERCENTAGE0.15, 12 13 14 15 16 TAX RATE = 0.09; int numberOfPizzas - 0, numberOfBurgers = 0, numberOfSushis 0, numberOfMovieTickets = 0; 18 19 20 21 double restaurantBill- 0.0, movieTicketspriceBeforeTax 0.0 restaurantBillWithTip - 0.0, movieTicketsPriceWithTax = 0.0, totalExpense -0.0; 23 24

23 24 25 26 27 totalExpense .0; System.out.printf Please input number of Pizzas to purchase: ); numberOfPizzas input.nextInt(); System.out.printf Please input number of Burgers to purchase: ); numberOfBurgers - input.nextInt); System.out.printf Please input number of Sushis to purchase: ); numberOfSushis input.nextInt); System.out.printf Please input number of MovieTickets to purchase: ); numberOfMovieTickets - input.nextInt(); System.out.printf( You will purchase: \n%d Pizzas\n%d Burgers\nKd Sushis from the restaurant\n , number0tPizzas, numberOfBurgers, number0fsushis ); restaurantBill PIZZA-PRICE * numberOfPizzas + BURGER-PRICE * numberOfBurgers + SUSHI-PRICE * numberOfSushis; System . out . printf( The restaurant bill before tip is: $%.2fin, restaurantBill ): restaurantBillWithTip TIP PERCENTAGErestaurantBill + restaurantBill System.out.printf( The restaurant bill with tip is: $%.2tinin, restaurantBillWithTip); System.out.printf( The number of Movie Tickets to purchase is: %d\n, number0fMovieTickets ); movieTicketsPriceBeforeTax-numberOfMovieTickets * MOVIE-TICKET-PRICE; System.out . printf( The price of Movie Tickets before tax is: $%.2f\n, movieTicket spriceBeforeTax ); movieTicketspriceWithTax = TAX-RATE * movieTicket spriceBeforeTax + movieTicketspriceBeforeTax; System.out . printf( The price of Movie Tickets with tax is: $%.2f\n, movieTicketsPriceWithTax ); tota!Expense = restaurantBillWithTlp + movieTicketsPriceWithTax; System.out.printf( The total expense for the evening !s: $%.2fin, totalExpense ); 29 30 31 32 34 35 37 38 39 40 46 47 Console X sterminated> BankAccountTester lava Applicationl CProgram Files lavalire1,8.0 171binliavaw.exe (lan 24, 2019, 11:51:52 AM

This is what I have so far for C++.
I'm not sure how to format printing in C++. Please run your code and make sure it works.

main.cpp Circle.cpp 1 billpay.cpp #include iostream» #include iomanip> 3 using namespace std; 4int main(void) 6 7 8 9 10 int PIZZA PRICE-18, burgerprice-7,sushiprice-5,movieticketprice-12; float tipper .15,taxrate-.00; int numberofpizza, numberofburger, numberofsushi,numberofmovietickets; float resterauntbill,movieticketpricebeforetax,resterauntbillwithtip,movieticketpricewithtax,totalexpense; cout<< Please input number of pizzas to purchase: cin>numberofpizzaj cout«cPlease input number of burgers to purchase: ; cin>>numberofburger cout<< Please input number of sushis to purchase: cin>>numberofsushi; cout«cPlease input number of movietickets to purchase: ; cin>>numberofmovietickets; cout<< You will purchase: %d restarauntbillwithtip resterauntbill-4.44444; cout<<setprecision (3)<<resterauntbill; 12 14 16 17 18 19 23

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution