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

PhD thesis

I need a comprehensive PhD thesis developed on the topic of “Emotion-Aware Artificial Intelligence and Sustainable Consumer Behavior: A Neuro-AI Marketing Framework for Continuous Green Consumption.”

Co project

· Comprehensive Literature Review: Require a more comprehensive survey of existing approaches. · Comparative Study: Expect more detailed benchmarking of at least 8 to 10 machine learning models. · Additional Experiments: · Conduct feature selection or dimensionality reduction as an extra step. · Explore ensemble methods or advanced techniques beyond

AI

Did AI take place the Software Engineers, HR consultants and Data Entry Jobs?

Data visualization 4 part 2

Follow the attached instructions to complete this work. Unit 4 Assignment Directions: Time Series In this assignment, you will perform a time series analysis in Tableau. · Choose a dataset to analyze based on the requirements provided.   · Once you’ve selected your time series, build a forecast to predict future

Computer Science CG Assignment 8 presentation

Follow the attach instruction to complete this work. Note: Make sure it aligns with Rubric Unit 8 Assignment 2 Directions: Final Presentation Purpose With this presentation, you will gain valuable experience demonstrating your expertise in cybersecurity governance by presenting as a CISO to a hypothetical professional audience.  Directions Begin by incorporating

Computer Science CG assignment 8

Follow the attached assignment to complete the work. Note: Follow Rubric Unit 8 Assignment 1 Directions: Presentation Rehearsal Purpose The rehearsal is your first run-through of your talk. Use the opportunity to de-bug any technical issues with lighting, positioning, and recording. You will not be graded on technical or artistic

Computer Science CG assignment 7 Outline

 Follow the attached document to complete this work Unit 7 Assignment 1 Directions: Professional Presentation Outline Purpose This assignment allows you time to review your research from previous units and organize your thoughts in an outline format. Plan on changing your paper and presentation based on feedback on this outline.  Directions

Computer Science CG assignment 6 ,

Follow the attached direction to complete this work. Note: Make sure it Aligns with Rubric Unit 6 Assignment 2 Directions: Timothy Brown vs. the SEC Purpose The Securities and Exchanges Commission (SEC) is a key US federal agency that regulates financial reporting. In this paper, you will explore how the

Microsoft 365Tenant to Tenant Migration Solution

A smooth tenant-to-tenant migration requires more than just moving mailboxes—it demands precision, security, and planning. With the MailsDaddy Cross-Tenant Migration Service, IT teams can execute a flawless cross-tenant mailbox migration that covers emails, attachments, calendars, contacts, and OneDrive data. It’s built for businesses of every size, ensuring the entire Office

CO Data 3

DECISION TREES for Risk Assessment One of the great advantages of decision trees is their  interpretability. The rules learnt for classification are easy for a person to follow, unlike the opaque “black box” of many other methods, such as neural networks. We demonstrate the utility of this using a  German

Computer Science Homework 1

MMIS 671 Homework 1. Constrained Optimization Problems A company produces 3 types of cables: A, B, and C. In-house production costs per foot of cables A, B, and C are $6, $8, and $10, respectively. The production process requires 5 resources: Drawing, Annealing, Stranding, Extrusion, and Assembly. For each resource,

MIMT

  Task 2.4 — Executing the Payload After decrypting and executing the transferred file, it generates a unique hash tied to your GTID. What’s the hash?

data Discussion 3

Follow the attached instructions to complete this. use the   CRM Sale Dashboard. Unit 3 Discussion: Deconstruction of an Advanced Dashboard: Trends and Improvements   Discussion Prompts · Does the dashboard designer use any of the trends that are described in Milligan’s Chapter 9? · If they did use those

Assign 4 of CG

Follow the attach instructions to complete this work. Make sure it alligns with rubric. Guidance to follow I encourage you to build your project format following the requirements established in each project’s final step. I am going to give you the key to success. I am a fan of headings/subheadings