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

  Store a list of student info

Store a list of student info, (id number, First name and Last name) using a link list. The ID is the key field. The program should implement a linked list using arrays.The program should process the following operations

  Develop a c program

develop a C program for Linux called pipes.c that does the following: In the main() function, it creates a pipe using the pipe() function, then creates two child processes with fork(). Child 1 redirects stdout to the write end of the pipe and then ex..

  Write cpp program that processes the data of retail company

Write a C++ program that processes the data of a retail company with following requirements: Define a new data type (struct) ofCustomer, with following members

  Generate a two-dimensional array

Generate a two-dimensional array of integers of 10 rows by 10 columns that contains 100 random numbers between 0 and 9. Print out the array (well formatted) and do the following computations

  What is the bug or logic error in the above program

What is the bug or logic error in the above program. Add the lines to fix it. This is an example of __nested__________ loops. How many times does the outer loop execute

  Class arrayprogram that generates an array of fifty integers

If the user does enter an integer, call a method named returnIndexValue to return the integer at the specified index in the array

  Make program using switch statements in visual basic/c++

Enter the year code, course code, number of units and output the year name, course name, tuition fee and the balance tuition fee of the student.

  Displays your name in the titlebar of the browser

Lab Assignment 1: Beginning HTML Due Week 2 and worth 40 points Deliverable: One (1) Web page (.htm) Follow the directions below to complete Lab Assignment 1: Using Notepad, or a similar text editor, create an .htm file that: displays your name an..

  Modify this pop() function, so that it uses recursion.

Rewrite the following power() function so that it uses recursion. Provide a function main to test the implementation.

  Converts an infix expression into a postfix expression

My goal is to implement a C++ program that converts an infix expression into a postfix expression and then evaluates the postfix expression. I am using the Stack and Queue classes I developed with a List class (linked list) that manages the data i..

  Creating a part number

Write C++ program that asks a user to enter a part number to order. The rules for creating a part number are as follows:

  The authors of the book do a very thorough job explaining

the authors of the book do a very thorough job explaining simpletons operation and encourage you to take a look at what

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