Program that will input any four float values

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

Program: You need to prepare a program to print the given output.

You are to write a program that will input any four float values where the four variables are declared in the 'main' function and perform the following calculations:

0.   read in four float numbers. (you have to pass in the four float variables by reference).

1.   print out the four numbers and the sum of the four numbers.

2.   print out the difference between the first and second number and the difference between the third and fourth number.

3.   print out the first number raised to the second number power (pow function) and the fourth number raised to the third number power.

4.   print out the largest of the four.  (This function, you will only pass in two arguments at one time.)

5.   print out the smallest of the four.  (This function, you will only pass in two arguments at one time.)

6.   print out a running total of the four numbers.  Ex 17.243 21.775  34.488.....  (This function, you will only pass in two arguments at one time.)

Read in the subsequent three numbers:   13.243   5.532    14.713   8.126  to test your code with.

Turn in the source code and the output file.

Restrictions: You have to use functions for each one of the above. You have to pass in two or three floats into each function and pass back the results. The main program is the only place you can do couts, no couts in any function.  Your 'main' can only have couts and function calls.

Note:  For #2 above, you will call the function twice

For  #3, call twice.

For #4 & #5, you will call the function 3 times? 

You need to implement this in C++ language. You need to provide the answer as soon as possible.

Reference no: EM13704467

Questions Cloud

Write a recursive definition that reverses the elements : Write a recursive definition that reverses the elements in intArray between low and high.
Write and debug a mips program : Write and debug a MIPS program that performs the given operations - Display one of the following statements depending on if a>b, or a=b or a
Determines if the input string is a valid lock combination : Write a Java program that satisfies the given requirement - Prompts the user to input exactly nine characters, which constitute a valid lock combination.
Write a program that reads a list of integer : Write a program that reads a list of integer and stores the integers in an array and write a function compact that eliminates all zeroes from its array parameter
Program that will input any four float values : You need to prepare a program to print the given output - write a program that will input any four float values where the four variables are declared in the 'main' function and perform
Explain tap water in making up the solvent mixture : Question- Why would you not want to use tap water in making up the solvent mixture (HCI + acetone) or rinsing out the beaker
Write the proper chemical formula for the compounds : Question- Write The Proper Chemical Formula for the following compounds: Copper(II) nitrate cobalt(II) nitrate, nickel(II) nitrate, iron(III) nitrate, hydrochloric acid, ammonium hydroxide, acetone and dimethylglyoxime
Calculate the molar mass of carbohydrate : Question- A solution of 6.85 g of a carbohydrate in 100.0 g of water has a density of 1.024 g/mL and an osmotic pressure of 4.61 atm at 20.0 C/. Calculate the molar mass of carbohydrate.
How many grams of urea must be added to water : Question- How many grams of urea must be added to 658g of water to give a solution with a vapor pressure 2.50 mmHg lower than that of pure water at 30 C

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Implement the graphics portion of the assignment

Analyze a basic set of requirements for a problem - Compose basic C++ language programs

  User that will be asked to input the time

Write a code for the following C++ problem. We will have a user that will be asked to input the time of a train traveling in terms of minutes and this minutes is a non-negative integer.

  Write a program that first prompts the user

Write a program that first prompts the user (repeatedly , if necessary) to supply a single digit(0,1,2..9) The program should repeatedly prompt the user for integer values until a sentinel value of 0 is entered to terminate the program.

  Write a c program for a hcs12 micro controller that writes

Write a C program for a HCS12 microcontroller that writes the value, 0x78, to Memory Location VAR1 and then calls a delay function. The delay function should generate a delay of 0.25 milliseconds

  Wrie a program that will generate a list of 10000 numbers

Wrie a program that will generate a list of 10000 numbers stored in an array with values 1 and 500.Print out any original 200 numbers to show the results(not one number per line either).Now sort the number using bubble sort

  Creates a bus class

write a program that creates a bus class. create a constructor that initializes the number of passengers and number of seats. declare four objects. use the default copy constructor to initialize two of the objects.

  1 write a c program that takes an eastern standard time

1. write a c program that takes an eastern standard time in hours minutes and secondsand prints it out in central

  . write a segment of code that prints the number of elements

Assuming the array x has been defined as: int x[n]; for some n and that values have been assigned to all the elements. Write a segment of code that prints the number of elements between (but not including) the largest and smallest values in the array..

  Program to print out invalid number to character

The integer must contain 3 distinct non-zero number, or the program will print out invalid number.it should print out invalid query.

  Inserts a node with info value x

Complete the code for a function that inserts a node with info      value x before, and a node with info value zafter,each node with      info value y in a linked list with first node pointer p.

  A constructor and a destructor

A constructor and a destructor, Insert a new element chosen by the user at the correct place in the list

  Calculating the gcd greatest common divisor

Write a C++ code for calculating the GCD Greatest Common Divisor between two positive integer numbers. You  should  use Euclid's  original  subtraction  based  GCD algorithm ( not  using  modulo operator).

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