Question

use elulel spaces or tab escape sequences 36. (10 pts) Write a program that will calculate the gratuity by reading in the bill (subtotal) and gratuity rate. Echo the inputs and output the result. For example, if the subtotal is $10 and the gratuity rate is 15%, output $10.00 + $1.50=$11.50 Include the dollar sign (s) in your output Your code must be syntactically correct (no need to write comments) Prompt for the subtotal and gratuity rate Calculate the total and display to exactly 2 decimal places Sample output Enter the subtotal: 10 Enter the gratuity rate (eg. enter 15 for 1596): 15 $10.00 + $1.50 = $11.50
0 0
Add a comment Improve this question Transcribed image text
Answer #1

PUT pagrom to read the ιο Claw Demt nt St, r - doube g,total Sanne Sc )

Add a comment
Know the answer?
Add Answer to:
use elulel spaces or tab escape sequences 36. (10 pts) Write a program that will calculate...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I submited this question before but they didnt follow the requirements/contraints or format...they didnt use methods....

    I submited this question before but they didnt follow the requirements/contraints or format...they didnt use methods. Please use comments. Write  a JAVA program that will ask for the customer’s last and current meter reading in Kilowatt Hours (KwHs). Determine the amount of usage for the month and calculate a subtotal (before tax) and a total amount due (tax included) using the following constraints. Constraints Rate A: For 500 KwHs or less = $0.0809 / KwH Rate B: For 501 to 900...

  • Write a C++ program that will calculate the total amount of money for book sales at...

    Write a C++ program that will calculate the total amount of money for book sales at an online store. For each sale, your program should ask the number of books sold and then the price for each book and the shipping method (‘S’ for standard shipping and ‘E’ for expedited shipping). The program will produce a bill showing the subtotal, the sales tax, the discount, the shipping charge, and the final total for the sale. The program will continue processing...

  • Write, compile, and test a C++ program that uses a loop to calculate and display each...

    Write, compile, and test a C++ program that uses a loop to calculate and display each employee’s weekly pay and the accumulated total pay for the company. The program will first ask the user for the number of employees. It will then ask for the number of hours and rate of pay for each employee and display the calculated pay for each employee. EXAMPLE RUN (user input appears in blue and bold): Enter number of employees: 3 Hours: 5 Rate...

  • Problem: Write a program to calculate the force of gravitational attraction between two objects of known...

    Problem: Write a program to calculate the force of gravitational attraction between two objects of known mass at a known distance. Use the formula developed by Isaac Newton known as Law of Universal Gravitation. F G*m *m2/d2 Where F (Force of gravity) is expressed in Newtons (N), mi and m2 (masses of the objects) are expressed in kilograms (kgs) and d (distance from the center of one object to the center of the other) is expressed in meters (m) and...

  • (Java) Rewrite the following exercise below to read inputs from a file and write the output...

    (Java) Rewrite the following exercise below to read inputs from a file and write the output of your program in a text file. Ask the user to enter the input filename. Use try-catch when reading the file. Ask the user to enter a text file name to write the output in it. You may use the try-with-resources syntax. An example to get an idea but you need to have your own design: try ( // Create input files Scanner input...

  • Use a java program that does the following: . (10 points) Write a program as follows...

    Use a java program that does the following: . (10 points) Write a program as follows a. Prompt the user to input two positive integers: nl and n2 (nl should be less than n2) b. If the user enters the negative number(s), convert it/them to positive number(s) c. If nl is greater than n2, swap them. d. Use a while loop to output all the even numbers between nl and n2 e. Use a while loop to output the sum...

  • write a program for C++ to use on Putty . C++ not Java The Fast Freight...

    write a program for C++ to use on Putty . C++ not Java The Fast Freight Company provides three kinds of shipping services for packages: regular, priority and overnight. They charge the following rates: Regular Priority Overnight <= 2 Kg $1.00 per Kg $3.50 per Kg $11.50 per Kg > 2 Kg but <=6 Kg $1.50 per Kg $5.50 per Kg $16.50 per Kg > 6 Kg but <=10 Kg $2.00 per Kg $7.50 per Kg $21.50 per Kg >...

  • Java Program: In this project, you will write a program called GradeCalculator that will calculate the...

    Java Program: In this project, you will write a program called GradeCalculator that will calculate the grading statistics of a desired number of students. Your program should start out by prompting the user to enter the number of students in the classroom and the number of exam scores. Your program then prompts for each student’s name and the scores for each exam. The exam scores should be entered as a sequence of numbers separated by blank space. Your program will...

  • Java I - Write a program that will use static methods as described in the specifications below. U...

    Java I - Write a program that will use static methods as described in the specifications below. Utilizing the if and else statements, write a program which will calculate a commission based on a two-tiered commission plan of 2% and 5% paid on amounts of $10,000 or less, or over $10,000 in monthly sales by a sales force paid on a commission basis. Use the output specifications below. --- (Please make detailed comments so I can better understand the code....

  • Write a program that will help a student learn multiplication. Use SecureRandom object to produce two...

    Write a program that will help a student learn multiplication. Use SecureRandom object to produce two positive integers between 1 and 20. The program should then prompt the user with a question (use a sentinel-controlled loop), such as: How much is 10 times 11? The student then inputs the answer. If the answer is correct display the message “very good” and ask another question. If the answer is wrong to display the message “no, please try again” and let the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT