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

  Write a c program that reads in five numbers

Q1. (Bar Chart /Histogram printing) Write a C program that reads in five numbers (each between 1 and 30). For each number read, your program should print a line containing that number of adjacent asterisks. For example, if your program reads the numb..

  C++ program to draw a correct texas flag using rectangles

Write a C++ program to draw a correct Texas flag using rectangles, lines, and/or polygons (not images).

  Write a program to simulate the process

Write a program to simulate the process of an n-bit (n x n) shift-and-add syn-chronous multiplier - Compare performance of an unsigned shift-and-add multiplier with one using a shift-over technique.

  Integer arguments representing feet

A constructor that will take a single integer argument representing a whole number of feet • A constructor that will take two integer arguments representing feet and inches respectively • A constructor that will take three integer arguments represent..

  Ansi-c program which allows the user to play a game

Your task is to write an ANSI-C program which allows the user to play a game. This will require I/O from both the user and from ?les.

  Write a class volumeofbox that calculate the volume

write a class VolumeOfBox that calculate the volume by this formula : length * breadth *

  Take the code you wrote for the ford-fulkerson algorithm

Take the code you wrote for the Ford-Fulkerson algorithm for the maximum flow on a directed graph with capacities, and implement scaling on top of this code. You write a function

  Calculate the celsius equivalent of a fahrenheit temperature

Prepare a program to calculate the Celsius equivalent of a Fahrenheit temperature

  Input parameters, and returns nothing

Write a function called ten2one(), that takes no input parameters, and returns nothing (void). The body of the function must include a loop that counts from 10 down to 1, printing the count value each time in the loop. The output should look like (no..

  Print each employee''s identification number

1) in a program you need to store the identification numbers of 10 employees (as ints) and their weekly gross pay (as doubles) A) Define two arrays that may be used in parallel to store the 10 employee indentificcation numbers and gross pay amounts B..

  Linked list with first node pointer p.

Complete the code for a function that replaces each occurrence of value x by value y in a linked list with first node pointer p.

  Program that uses an instance of the timeoff

Write a program that uses an instance of the TimeOff class you designed in Programming Challenge 5. The program should ask the user to enter the number of months an employee has worked for the company. It should then use the TimeOff object to calc..

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