Our Services

Get 15% Discount on your First Order

[rank_math_breadcrumb]

HW 4

PLEASE REVIEW THE INFORMATION BELOW 

Submit the .cpp source code file on Ecampus.

Write a program that has the main menu listed below.  It should be in a while loop that repeats until the user selects 6 to Exit.

Program 1 Example Output

1 = Convert Fahrenheit to Celsius
2 = Convert Miles to Kilometers
3 = Convert Pounds to Kilograms
4 = Calculate value of coins
5 = Print for loop patterns
6 = Exit

Enter Your Choice: 2

Enter the number of Miles: 2
This is 3.3333 Kilometers

<program loops and goes back to main menu>

1 = Convert Fahrenheit to Celsius
2 = Convert Miles to Kilometers
3 = Convert Pounds to Kilograms
4 = Calculate value of coins
5 = Print for loop patterns
6 = Exit

Calculating value of coins – Ask the user how many pennies, nickels, dimes, and quarters they have.  Output the dollar value of the coins.

Also, output various comments about the dollar value of the coins.  For example:

Dollar Value

Output

< $0.50

You need to search for some pennies.

>= $0.50 and < $2.00

You can barely buy a soda.

>= $2.00 and < $5.00

You can eat at McDonald’sl

>= $5

All those coins must be heavy.

Example Output

How many pennies do you have? 3
How many nickels do you have? 2
How many dimes do you have? 1
How many quarters do you have? 2

The dollar value is $0.73
You can barely buy a soda.

Optional: The user would like to exchange their coins so that they will have the same amount of money, but with the fewest possible coins.  Tell the user the fewest coins that will add up to the same dollar amount.

Print for loop patterns – Use for loops to print the following patterns:

Pattern 1 – use a single for loop to print every 5th number from 105 – 500.  There should be 20 numbers per line.
Pattern 2 – use a nested for loop to print asterisks with 1 on the first line, 2 on the second line, … 10 on the tenth line.
Pattern 3 – use a nested for loop to print dollar signs with 10 on the first line, 9 on the second line, … 1 on the last line

Example Output

~~ Pattern 1 ~~
105 110 115 120 125 130 135 140 145 150 155 160 165 170 175 180 185 190 195 200
205 210 215 220 225 230 235 240 245 250 255 260 265 270 275 280 285 290 295 300
305 310 315 320 325 330 335 340 345 350 355 360 365 370 375 380 385 390 395 400
405 410 415 420 425 430 435 440 445 450 455 460 465 470 475 480 485 490 495 500
~~ Pattern 2 ~~
*
* *
* * *
* * * *
* * * * *
* * * * * *
* * * * * * *
* * * * * * * *
* * * * * * * * *
* * * * * * * * * *
~~ Pattern 3 ~~
$ $ $ $ $ $ $ $ $ $
$ $ $ $ $ $ $ $ $
$ $ $ $ $ $ $ $
$ $ $ $ $ $ $
$ $ $ $ $ $
$ $ $ $ $
$ $ $ $
$ $ $
$ $
$
 

Share This Post

Email
WhatsApp
Facebook
Twitter
LinkedIn
Pinterest
Reddit

Order a Similar Paper and get 15% Discount on your First Order

Related Questions

CSIA 310 wk2 discussion

  Write a short “newsletter” article (3 to 5 paragraphs) for the non-technical managers and employees at Sifers-Grayson to explain the following: (a) What is Phishing? (Focus on phishing emails and targeted attacks that include spear phishing and whaling.) (b) What “bad things” can happen when a successful phishing attack

Project 3

To complete this assignment, review the prompt and grading rubric in the Project Three Guidelines and Rubric. When you have finished your work, submit the assignment here for grading and instructor feedback.

digital marketing

 Digital marketing involves promoting products and services using online platforms.The goal is to increase brand awareness and drive sales 

WEEK 2 DISCUSSION MR

 I UPLOADED IN THE FILE HOW THE ASSIGNMENT SHOULD FLOW AND ALSO THE ACCEPTABLE TOPICS FOR MY PROGRAM THAT U CAN SELECT FROM!  INSTRUCTIONS!! This week you considered study topics deemed acceptable for your program. For this discussion, share with your peers your initial thoughts on a topic you’d like

wk 2 practice models

INSTRUCTIONS!! Discuss the various practice models discussed in Chapter 3 of The Ernst and Young Business Plan GuideLinks to an external site.. What model is the most attractive for your own consultancy? Why? Do you see the model for your practice changing in the future?   READ CHAPTER 3!! OF THE

Computer Science Sustainable Development Goal and Mobile App Assignment

ATTACHED IS THE COPIED STATEMENT ON INTEGRATION OF FAITH AND WORK A s a university, we believe that the message of Jesus Christ bears profound implications, not only for individuals, but also for society and the ways that we as individuals live within it. The Lord Jesus instructed His followers

Intro Pogramming

After viewing the videos and listening to the information on programming, you should be ready to answer the questions listed below.     Your assignment is as follows:  I.   Access the Youtube videos:    Introduction to Programming Fundamentals (by Neso Academy).  You will be responsible for accessing the first 3 videos in

Disruptive technology and its impact on society (Discussion)

A discussion on disruptive technology and its impact on society 1) Discussion 1: Write a reflective response to the lesson on disruptive technology and its impact on society. (200-word minimum) Explore the impact on a macro and micro level looking at the impact on systems and structures as well as the

week 1 begin your

 I am a Kroger fulfillment delivery driver trainer / and I am also a TECH SUPERVISOR for spectrum whichever job you find easier to discuss about share something from your profession, job, or other source of inspiration that generated the idea for your project. What do you want to learn

project 2

To complete this assignment, review the prompt and grading rubric in the Project Two Guidelines and Rubric. When you have finished your work, submit the assignment here for grading and instructor feedback. For reference, refer to the CIA Triad and Fundamental Security Design Principles PDF document.

project 1

To complete this assignment, review the prompt and grading rubric in the Project One Guidelines and Rubric. When you have finished your work, submit the assignment here for grading and instructor feedback.

Final SWOT presentation

Concepts and Applications of Information Technology (IFSM201) Class Project Purpose of this Assignment The Class Project is the most significant assignment in this course, Concepts and Applications of Information Technology. As such, it accounts for 58% of the course points. This assignment is comprised of two deliverables: a SWOT Analysis

Wk4_411

Need help with a question. Due 10/7/2024 Based on your research, readings, and this week’s Learning Team assignment, create a 4- to 5-page sample penetration agreement for a banking institution using the major sections listed below and the purpose of each section. Include examples within each section. The major sections

Discussion 7 Social Networking

  Discussion Seven – Social Networking Social networking Web sites create online communities of Internet users that eliminate barriers created by time, distance, and cultural differences. These sites allow people to interact with others online by sharing opinions, insights, information, interests, and experiences.  Members may use the site to interact

Cap assign

Unit III Scholarly Activity Top of Form Bottom of Form Assignment Content Top of Form Purpose, Subject, Object, and Ethics In this unit, you will determine the purpose, subject, object, and ethical considerations of your case study, then assemble your findings in the  Unit III Case Study Outline Template .

project 3:

Support Queue Case Study Instructions:  Select two tickets from each level and explain how you would solve them. Name:  Level 1 Tickets Instructions:  Select two of the five scenarios to troubleshoot.  One template has been created for each of the two tickets you need to choose.  Make one to two

case

Write three pages of high-quality content for this case study, using the concepts discussed in class and any relevant external resources to support your analysis. Follow the instructions for your research problem carefully, as your argument and research will significantly impact your grade. Ensure that AI patterns do not exceed