Write a program containing a for loop

Assignment Help C/C++ Programming
Reference no: EM131195236

C++ PROGRAMMING ASSIGNMENT-

Fifty people (50) completed the following questionnaire:

Are u interested in        Very Much              Moderately        Not at all

Soccer?                       --------------         --------------         ----------

Rugby?                        --------------         --------------         ----------

Tennis?                        --------------        --------------         ----------

Athletics?                     --------------         --------------         ----------

Cycling?                      --------------         --------------         ----------

The information is encoded as follows: "if very much" has been marked, it is indicated by 1; if "moderately" has been marked, it is indicated by 2; if "not at all" it is indicated by 3.

Write a program containing a for loop (going from 1 to 50) where the answer (1, 2 or 3) of each respondent to each question is read in. (You will need five variables of type int for this). The program has to determine

  • The number of people who are not interested in any of the five sports
  • The number of people who are very interested in soccer, but not at all in rugby, and moderately or not at all interested in cycling
  • The number of people who are very interested in both athletics and cycling, but only moderately or not at all in tennis and display the three totals. Use one nested if statement in your program. You should do some error checking: only 1 or 2 or 3 may be read in. (use a do ...while loop, keep prompting the use to enter 1 or 2 or 3 if something else has been type in until the input is correct.)

Reference no: EM131195236

Questions Cloud

Reading of a collection of animal objects : Allow the reading of a collection of animal objects from an external file. Output on screen the content of a collection of animal objects. Use Iterator to achieve these goals.
Explain why spiritual assessment is important : Explain why spiritual assessment is important in terms of the "five Rs": Reason, Reflection, Religion, Relationships, and Restoration. In your opinion, which is the most important and why? As a health care practitioner, how would you support th..
What is the secondary peak current : Assume an input of 120 V RMS, 60 Hz to a 20:1 stepdown transformer. Also assume a load resistor of 200 Ohms. What is the primary or input peak voltage? What is the secondary peak voltage? What is the secondary peak current?
Leasing and buying to cost the same : How many kilometers must a car be driven per year for leasing and buying to cost the same? Use 10% interest and year-end cost. Leasing: $0.15 per kilometer Buying: $5000 purchase cost, 3-year life, salvage $1200, $0.04 per kilometer for gas and oil, ..
Write a program containing a for loop : SCSC011 PRACTICALS: C++ PROGRAMMING ASSIGNMENT. Write a program containing a for loop (going from 1 to 50) where the answer (1, 2 or 3) of each respondent to each question is read in. (You will need five variables of type int for this). The program..
Determine the time required to complete a filling : Truck has a compaction ratio of 1:2. Pickup time is 1.58 min per service. Truck spends 20 min at the disposal site. It takes 35 min to drive to the disposal site. Assume a density of 250 lbs/cubic yard for uncompacted refuse and 500 lbs/cubic yard..
Introductory statement of the company : Write an introductory statement of the company including but not limited to the type of the company, the location, the industry in which it competes, and the organizational vision and mission that encompasses the nature of the company.
Discuss advantages of leasing capital equipment : Discuss advantages of leasing capital equipment
Explain how the ratios are calculated : Write a 750- to 1,050-word paper in which you summarize the financial performance of the organization. Explain how the ratios are calculated and how the results impact the organization. In addition, explain how the organization is performing compa..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  What is the size of the hash table

What is the size of the hash table?What are hFint256() (16) and hFint256() (257)?

  Create your own unique while-end repetition code

Create your own unique While-End or (For End) repetition C code. You decide the theme. Be sure to provide an overview of what your repetition structure is doing.

  Write a value-returning function arraymaximum()

Write a C++ program that uses a two dimensional array, testgrades[][], for 10 students and scores from 5 tests.

  Program that declares three variables minnum

Write a C++ program that declares three variables minNum, midNum and maxNum to receive three integers read from the keyboard.

  Write a sumo robot c program

Write a sumo robot c program for an aduino board, using 2 motors. 2 phototransistors and 2 Led sensors( sensors 2 for the front and 2 for the back ) which are going to be responsible for keping the robot in the sumo ring, making sure the robot com..

  Object oriented programming

Define the concept of polymorphism as used in object oriented programming.

  A palindrome is a number

A palindrome is a number or text phrase that reads the same backward as forward. For example, each of the following five-digit integers is a palindrome: 12321, 55555, 34543 and 11611. Write a program that reads in a five-digit integer and determines ..

  Write a program that is called playing with numbers or

write a program that is called playing with numbers or letters. this program allows a user either to enter a collection

  Write a program that will read in 2 test score.

Write a program that will read in 2 test score. The instructor has decided to give each student 10 bonus point on each test. Print out each test score and the total after the bonus, the print the total number of points earned on the tests.

  Two-dimensional array of double to hold the sales

Suppose you have a two-dimensional array of double to hold the sales amounts for all your salespeople three years. Assume you employ 50 salespeople and this array already holds valid data.

  Print the matrix in a format and transpose of the matrix

Write a program which asks the user for 9 integers representing the elements of a 3 by 3 matrix by rows, stores the numbers in a 2-dimensional C++ vector, prints the matrix in a pretty format, prints the transpose of the matrix in a pretty format,..

  Make a program to play lottery

make a program to play lottery. The program randomly generates a Lottery of a three-digit number( any number from 100 to 999), prompts the user to enter a three-digit number, and determines

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