Program to print smallest number and largest number entered

Assignment Help Programming Languages
Reference no: EM1369206

1. Write a C++ program; LargestSmallest.cpp; that inputs 6 real numbers from the user and finds and prints the smallest number and the largest number entered.

2. Write a program to find out and print, for a class of students, the number of families with 1, 2 ,3 ...up to 6 or more children. The data in entered by the user and consists of the number of children in each pupil's family, terminated by a 0.

3. A lecturer needs a program to calculate the average of all her students' scores and print the score and the differences from the average. Assume that the class has 5 students. Write a program which allows the teacher to enter the 5 scores and then prints the score and it's difference from the average.

4. In an election, there are 5 candidates numbered 1- 5. Each voter is allowed 2 votes: A first and second choice. The first choice gets 4 points and the second choice gets 2 points. One line of input corresponds to one voter's choices. For example, the input line: 1 2 means that, for this voter, candidate 1 is the first choice and candidate 2 is the second choice. The number of votes is unknown beforehand and data is terminated by an input line: 0 0
Write C++ code to do the following.

a. Prompt the user for two values which represent the voter's choices.
b. Check if both votes are valid candidates and store the relevant data
c. Print the number of rejected votes and the number of valid votes
d. Print the candidates and their scores and the winner.

Reference no: EM1369206

Questions Cloud

What issues related to microeconomics rather macroeconomics : Which of graphs below shows Y increasing at a decreasing rate. Which of following issues is related to microeconomics rather than macroeconomics.
Explain what the wic organization still needs : Explain what the WIC organization still needs to do [in terms of improving its target population] and what are its current goals of WIC?
What is the pressure on the guage now : On a cool morning, when the temperature is 14 degrees C, you measure the pressure in your car tires to be 30 psi. After driving 50 mi on the freeway, temperature of your tires is 52 degrees C.
Relationship in consumption expenditures and inventory : Since inventories are not a large component of GDP, how can they affect GDP so sharply explain how will the replenishment cycle affect GDP in the near future?
Program to print smallest number and largest number entered : Write C++ program; LargestSmallest.cpp; which inputs six real numbers from user and determines and prints smallest number and largest number entered.
How does tows and risk play together : How could TOWS help to manage unstable environmental issues, like government or the price of fuel and how does TOWS and risk play together?
Conclude the tension in the wire : You are driving to grocery store at 21. You are 100 from an intersection when the traffic light turns red. Presume that your reaction time is 0.75 and that your car brakes with constant acceleration. How far from the intersection are you when you ..
Analyse how continuous process flow : LEAN THINKING Analyse how continuous process flow can help an organisation to reveal waste. What advantages do lean organisations hold over traditional organisations in terms of creating value for customers?
Find problems of us banks at the end of 1980 : According to Gerald Baker, columnist for London Financial Times, November 23, 1999, "In the US, banks are, by whichever measure chosen, in unusually good shape for this stage of an expansion.

Reviews

Write a Review

Programming Languages Questions & Answers

  Program to display the bonus

product receives a 5% bonus, otherwise, he receives a 4% bonus. Display the bonus, formatted with a dollar sign and two decimal places, in the bonusLabel.

  Write a program to read student data from standard input

Write a program to read student data from standard input, sort it by last name / first name, and print result to standard output.

  Write a paper on memory management

Write a paper on Memory Management

  Program to display aggregate information for state

For each state, display aggregate information for that state, including: the total number of counties in the state, the total number of tax returns.

  Design and implement a class contains instance data

Design and implement a class called sphere that contains instance data that represents the sphere's diameter. Define the Sphere constructor to accept and initialize the diameter.

  Pseudocode that will generate reports from data files

Develop a mock-up of each of these reports, and get customer approval of these mock-ups. Write pseudo code that will generate these reports from the data files, using a CASE tool;

  Program to use next character to create and return operator

Convert the string of digits into an integer. Otherwise, use the next character to create and return an operator.

  Design a class for string field for toppings

Design a class named pizza. Data fields include a string field for toppings (such as pepperoni) and numeric fields for diameter in inches (such as 12) and price (such as 13.99).

  Design program to enter a series of numbers

Design a program that asks the user to enter a series of 20 numbers. The program should determine whether the number is valid by comparing it to the following list of valid charge account numbers.

  Create default constructor which invokes superclass

Create a (default) constructor which invokes superclass constructor with value 3 (law school is typically a three year program).

  Pseudocode to create thread-safe countdownevent by locks

Write pseudocode to implement a thread-safe CountdownEvent using locks and condition variables by implementing the following methods (lists 4 methods) and then "implement a Barrier using a CountdownEvent.

  Design getter and setter and constructor methods

User must have option to draw new shape at different location and keep the existing shape. Design all the getter and setter & constructor methods for each class.

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