This
unit deals with branching in procedures. Depending on the outcome
of a logical condition we may want our program to follow one
of two paths and in some cases one of several paths. This is
accomplished by the use of if statements and switch statements.In addition, in this unit, we will learn how to read
from user supplied data files and how to create such files,
and we will discuss the mathematical library functions available
in C++ and the methods of their usage.
Write
and execute a program which prompts for and reads the radius of
the base and the height of a circular cylinder , calculates and
prints to the screen the volume and total surface area of the
cylinder ( no need to submit this work).
Write
and execute a program which prompts for and reads 3 numbers a,b,c
and prints to the screen only the positive ones ( no need to submit
this work).
Write
and execute a program which prompts for and reads a number x,
calculates y according to the rule y = 4/3 x for positive x, and
y = -0.5 x for negative x. It prints out to the screen x and y
with labels, and in addition prints the result to a file called
valuespos.txt if x>0 but to a file valuesneg.txt if x <0.
( no need to submit this work). The answer