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

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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