Pages

Monday 3 October 2011

cs101 Assignment 4 Fall 2011


Solution
Assignment 4

Fall 2011




a) Write an algorithm for a program that reads in three non-negative integer numbers and reports the maximum number, minimum number and average number. Write it in simple English, no need of any programming language syntax.


Solution:

1. Declare 3 integer variables a,b,c
2. Get input from the user or hard code the values
3. Declare a new variable max, and check the a ,b and c for the max number, and assign the largest value to max
5. Declare a new variable min, and check the a ,b and c for the minimum number, and assign the smallest value to min
4. Declare a new variable avg, and take an average of three numbers, by adding them and divide the total by three and assign the average value to avg
6. display the values of max, min and avg.


















b) Create a similar word document as shown below. Write your own name, roll no and addresses in the end as shown below.
 
(b) Solution REGARDING FORMATTING THE PARAGRAPG

   You can format the Paragraph as shown above by first selecting the text that you want to format. Then from the menu bar, select FORMAT, then select COLUMNS, there you will find different options of formatting. Select the required option and that’s it.






c) Draw the following AutoShapes and word Art in the exact format and style as shown below in Figure 1. Write your own name in place of “Your Name”.

Figure 1