Ask Computer Engineering Expert

Assume a newspaper wants to display the sales in each quadrant of town.
The quadrant, number of customers, and sales are:
In the Northwest quadrant, 23 customers with sales of $ 345.00
In the Northeast quadrant, 156 customers with sales of $ 2111.11
In the Southwest quadrant, 9 customers with sales of $ 120.80
In the Southeast quadrant, 222 customers with sales of $3030.35
Requirements :
prepare a program, using output manipulators, to produce the following output exactly:
Output Notes:
• The Newspaper and Month values are aligned on the right.
• The 'T' of the "Town" column label appears in column 6 of console screen
(i.e. there are 5 spaces before the word "Town").
• The Number of Customers and Month's Sales values are rounded to 2 decimal places
and are aligned on the right.
Do not convert the Number of Customers and Sales values in the code to strings (e.g. "23" or
"345.00"). They should both be coded in the output statements as numbers (e.g. 23 and 345.00).
Minimally, you must use the setfill output manipulator to create and format the dividing lines, and
you must use the setw and setprecision output manipulators to format the numeric output in the
table.
No variables or constants should be used in this program.
Newspaper: Daily Herald
Month: June 2014
#===================================#
Town Number of Month's
Quadrant Customers Sales
#===================================#
Northwest 23 345.00
Northeast 156 2111.11
Southwest 9 120.80
Southeast 222 3030.35
#===================================#


Program #2
prepare a program that computes a bill for newspaper delivery for a charge period (weekly, monthly,
annually, etc).
The charge for the daily newspaper is 52 cents. The charge for a Sunday newspaper is 75 cents.
Customers may also tip a percentage of the monthly bill.
Since the number of days in a charge period varies, the program will need to do some calculations.
Prompt the user for the number of days in the charge period and a tip percentage. Use these figures
to find out the total bill.
For every 7 days, charge for 6 daily papers and 1 Sunday paper. Remaining days will be charged at
the daily rate. (Hint: Use the division operator (/) to determine the number of full weeks/Sundays,
and use the modulus operator (%) to determine the number of remaining days over the full weeks).
Requirements:
The program must:
• Define an integer constant that holds the number of daily papers in one week.
• Define two floating point constants that will hold:
o The cost of a daily newpaper
o The cost of a Sunday newspaper
• Define a string constant for the customer's name - use YOUR name
(e.g., "Samantha Washington")
• Define two character variables for the quadrant of town being served
o One will hold a character representing either the north or south side of town
- Initialize this value to 'S' for south, when you define it
o One will hold a character representing the east or west side of town
- Initialize this value to 'W' for west, when you define it
• Define an integer variable to store the number of days in the charge period
(read from the user)
• Define a floating point variable to store the tip rate (read from the user)
• Define five floating point variables to store parts of the total cost, the subtotal and the total.
o The cost of all Sunday papers
o The cost of all daily papers
o The newspaper subtotal
o The tip charge
o The total bill
©2014, Regis University
• Display a program description, followed a prompts and input statement to read number of
days in the charge period from the user.
Sample Input
• find out the newspaper costs and then the tip.
• Add all of the above together to determine the total.
• Add any other variable definitions or calculation statements you think are needed to perform
the task
• Display a few blank lines to separate the input from the output. Then use output
statements to display the results to the console, in the following format:
NOTES:
o The dollar figures in the totals column should all line up, aligned right, on the
decimal point.
o If the customer enters 0% for the tip, the tip displayed will be 0.00.
Documentation
1) For each program, be sure to include top of program comments
(as specified in course Content section 1.8) that include:
Your name, the course, and the assignment number
What the Program Does including:
What is Input
Processing/Calculations Performed
What is Output
Customer: Samantha Washington
Location: SW quadrant
Days in Period: 30
Tip Rate: 4.2%
Cost for daily papers 13.52
Cost for Sunday papers 3.00
---------
Newspaper Total 16.52
Tip for Carrier 0.69
---------
Total Billed to Customer 17.21
Newspaper Billing Program
Enter number of days in the charge period: 30
Enter tip percentage (e.g. 5.5 for 5.5% or 0 for none): 4.2
2) Clarifying comments beside constants and variable declarations
3) Inline clarifying documentation, as needed. 

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M986393

Have any Question?


Related Questions in Computer Engineering

Does bmw have a guided missile corporate culture and

Does BMW have a guided missile corporate culture, and incubator corporate culture, a family corporate culture, or an Eiffel tower corporate culture?

Rebecca borrows 10000 at 18 compounded annually she pays

Rebecca borrows $10,000 at 18% compounded annually. She pays off the loan over a 5-year period with annual payments, starting at year 1. Each successive payment is $700 greater than the previous payment. (a) How much was ...

Jeff decides to start saving some money from this upcoming

Jeff decides to start saving some money from this upcoming month onwards. He decides to save only $500 at first, but each month he will increase the amount invested by $100. He will do it for 60 months (including the fir ...

Suppose you make 30 annual investments in a fund that pays

Suppose you make 30 annual investments in a fund that pays 6% compounded annually. If your first deposit is $7,500 and each successive deposit is 6% greater than the preceding deposit, how much will be in the fund immedi ...

Question -under what circumstances is it ethical if ever to

Question :- Under what circumstances is it ethical, if ever, to use consumer information in marketing research? Explain why you consider it ethical or unethical.

What are the differences between four types of economics

What are the differences between four types of economics evaluations and their differences with other two (budget impact analysis (BIA) and cost of illness (COI) studies)?

What type of economic system does norway have explain some

What type of economic system does Norway have? Explain some of the benefits of this system to the country and some of the drawbacks,

Among the who imf and wto which of these governmental

Among the WHO, IMF, and WTO, which of these governmental institutions do you feel has most profoundly shaped healthcare outcomes in low-income countries and why? Please support your reasons with examples and research/doc ...

A real estate developer will build two different types of

A real estate developer will build two different types of apartments in a residential area: one- bedroom apartments and two-bedroom apartments. In addition, the developer will build either a swimming pool or a tennis cou ...

Question what some of the reasons that evolutionary models

Question : What some of the reasons that evolutionary models are considered by many to be the best approach to software development. The response must be typed, single spaced, must be in times new roman font (size 12) an ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As