CSC 415 / CSC 425 Fundamentals of Computer Problem Solving / Introduction To Computer Programming
CSC 415 / CSC 425 Fundamentals of Computer Problem Solving / Introduction To Computer Programming
Assignment 4
1. Write a complete program that have two functions named CylinderVolume() and
CylinderArea(). Both functions should receive diameter and height of cylinder as
parameters. Each function should return the volume and area respectively to main
program. Given formula:
Cylinder volume,
Cylinder area,
where
The main program should repeatedly ask inputs until the user input 0 indicating the
termination of the program.
2. Write a program with a function named printTriangle(). The function has two
parameters, first is integer number and the second is a character. The function will
print the figure of triangle depending on user-preferred size and type of character.
Sample input/output:
Enter size: 2
Enter character: #
Output:
#
##
Enter size: 5
Enter character: @
Output:
@
@@
@@@
@@@@
@@@@@
Enter size: 4
Nabil 2014
Nabil 2014