Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using the vim editor, create Go programs that solve the following problem: The Copy Cost Problem: Leo's Print Shoppe charges 10 cents per copy for

Using the vim editor, create Go programs that solve the following problem:

The Copy Cost Problem: Leo's Print Shoppe charges 10 cents per copy for the first 200 copies and 5 cents and per copy for each additional copy. Write a program that asks for the customer's name and how many copies they need. Your program should output the customer's name and the total cost.

The Copy Cost Problem

At the end of the customer output, ask the user if she would like to go again

Have your program loop the inputs, calculations, and outputs for each customer

Use the Printf function to format your output

The spacing and formatting precision should exactly mirror that as shown below:

image text in transcribed

The Copy Cost Problem

Write a function that does the following:

o It should take one parameter, an int, that is the number of copies

o It should return one value, a float64, that is the total charge

o The same formula should be used as given from previous assignments

No literal values should be hard-coded into your program. You must use constants.

//---------------------------------------------------------------------------------------------Text for copy

Enter customer name: Mark

Enter number of copies: 40

Customer name: Mark

Total cost: $Z.ZZ

Another customer (Y/N)? Y

Enter customer name: Jill

Enter number of copies: 150

Customer name: Jill

Total cost: $Z.ZZ

Another customer (Y/N)? Y

Enter customer name: Kerryon

Enter number of copies: 87

Customer name: Kerryon

Total cost: $Z.ZZ

Another customer (Y/N)? N

//---------------------------------------------------------------------------------------------Text for copy

Additional comments throughout the program should be included where appropriate.

File should be run as text files with ".go" extensions and Show output.

Enter customer name: Mark Enter number of copies: 40 Customer name: Mark Total cost: $z.zz Another customer (Y/N) ? Y Enter customer name: Jill Enter number of copies: 150 Customer name: Jill Total cost: $z.zz Another customer (Y/N)? Y Enter customer name: Kerryon Enter number of copies : 87 Customer name: Kerryon Total cost: SZ.ZZ Another customer (Y/N)? N

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

More Books

Students also viewed these Databases questions