Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 1 Sales Prediction The West Coast sales division of a company generates 58 percent of total sales. Based on that percentage, write a program

Problem 1

Sales Prediction

The West Coast sales division of a company generates 58 percent of total sales. Based on that percentage, write a program that will predict how much the West Coast division will generate

based on the total sales entered by a user.

Example:

Enter total sales: 1500000

West Coast sales division generated: $870000

Problem 2

Write a program that computes the total bill including tax and tip on a restaurant bill. Prompt the user to enter the meal charge. Compute the tax of 9.75% and a tip of 20% of the total after tax has been added. Store each result in a separate variable. Output the sales tax, tip, and the total. Format the output as shown below.

Read http://www.cplusplus.com/reference/iomanip/setprecision/

about limiting decimal

points by using: cout << setprecision(2) << fixed << showpoint;

Read http://www.cplusplus.com/reference/iomanip/setw/

about reserving space and aligning output using: cout << setw(5) << var;

Hint: Dont forget to include

Example:

Enter meal charge: 32.95

Sales tax: $3.21

Tip (20%): $7.23

Total:$43.40

Problem 3

1.Find the compile errors in the following program and fix them. Hint: Dont forget the return 0;

statement.

2.Properly format the code to be clean and organized according to the instructions above.

3.Run the program with 5 and 0 as input and observe the output.

Then add a condition to the program that prevents the runtime error above and prints an error message instead.

4. The quotient is always an integer value. Change the code so that the quotient variable will always store the proper floating point value of the division.

#include >iostream<

void main[]

{

int number 1, number2:

float quotient;

cout<<"Enter two numbers./n";

cout<<"Enter the first number:";

cin <

cout>>Enter the second number: ;

cin <

cout<

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Relational Model A Retrospective Review And Analysis

Authors: C. J. Date

1st Edition

0201612941, 978-0201612943

More Books

Students also viewed these Databases questions

Question

Design a health and safety policy.

Answered: 1 week ago