Prompts the user for an integer number

Assignment Help Basic Computer Science
Reference no: EM132263854

1. Program that prompts the user for an integer number from the keyboard, and store it in a variable num. After each number is typed in, add num to a total.

Repeat five times, each time adding num to a total. (Be sure to reuse the same variable named num for each of the six numbers entered.) When all six numbers have been entered from the keyboard, calculate an average.

Display the total and average calculated.

2. This program requires you to use a loop as well as the switch statement. You will display this menu on the screen.

(Press 8 to stop voting)

The Many Colors of M&M's Candy

1. black

2. yellow

3. brown

4. yellow

5. green

6. White

Vote on your favorite color by pressing the number before it.

In this program, you will keep track of the number of votes for each color of M&M's candy. The user will be able to vote until he/she types the sentinel character 9. Display the menu and ask the user to enter a number. Check the number entered against the numbers 1 - 2 - 3 - 4 - 5 - 6. If the number entered is 1, add one to the redctr. If the user has entered 2, add one to the bluectr, etc.

When the user has pressed the 9 to exit, print out a display telling how many votes each color received.

3. Program that includes a function picnic() that will accept a floating-point number total and the addresses of the integer variables hotdogs, hamburgers, salad, pickles. The passed floating-point number represents the total amount of money to be spent on food. The function is to determine the quantity of hotdogs, hamburgers, salad, and pickles that can be purchased, writing these values directly into the respective variables declared in the calling function.

This function will be called from the main program and when it returns to main, it will print out the values of hotdogs, hamburgers, salad, and pickles.

Our favorite foods are in this order:

1. hot dogs--$2.00 each

2. hamburgers--$1.50 each

3. salad--$2.25 each

4. pickles--$1.01 each

For example, if I enter a total amount of money of $3.78, I can bring the following items to my picnic:

4 hot dogs

2 hamburger

3 salad

1 pickles

Reference no: EM132263854

Questions Cloud

Cause unplanned service interruptions : DHCP is a very promiscuous service, and this can cause unplanned service interruptions if not configured properly. Explain.
Define cost of capital for a new enterprise : Define Cost of Capital for a new enterprise. Describe the various layers of the capital structure and how they can be used to balance the Cost of Capital.
What your organization does to implement the stated control : Download the Cloud Security Alliance (CSA) Cloud Controls Matrix spreadsheet. (A quick Internet search should give you the address of the most current version.
Income tax based on the old income tax rate : Make an R program to compute the income tax based on the old income tax rate:
Prompts the user for an integer number : Program that prompts the user for an integer number from the keyboard, and store it in a variable num. After each number is typed in, add num to a total.
Enhancement and pre-structuring techniques : Also, discuss input enhancement and pre-structuring techniques that exploit space for time with an example (please do not use the same example as your peers).
Third normal form : To take this motley crew of tables to Third Normal Form (3NF), we must now take 2NF tables and eliminate all transitive (i.e., hidden) dependencies.
What conclusions have you been able to draw : Based on your research, what conclusions have you been able to draw related to your final presentation topic? Please describe your final presentation topic.
Explain why the climate change could be viewed : Discuss and analyse this issue of CC in the context of complex problem - explain why the Climate Change could be viewed as a wicked problem

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd