Display of Different Things-Computer Programming-Assignment, Exercises of Computer Engineering and Programming

This assignment was given by Dr. Jyoti Lokesh at Biju Patnaik University of Technology, Rourkela for Computer Programming course. It includes: Computer, Programming, Display, Hourglass, Pattern, Diamond, Nepal, Flag, Ladder, Negative, Number

Typology: Exercises

2011/2012

Uploaded on 07/13/2012

ekvir
ekvir 🇮🇳

4

(1)

35 documents

1 / 5

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
April 11, 2012
Assignment # 2
Course No. CS1124
Course Title Computer Programming
Due Date: Monday April 16, 2012 at 12:00pm
In this assignment you have to write a program that starts by displaying the following menu to user:
Select one of the following choices:
1. Display an hourglass pattern
2. Display a diamond pattern
3. Display the Nepal flag
4. Display the ladder pattern
When the user selects choice 1, you will ask him/her for the size of pattern and the symbol to be used in
the pattern. If user enters a negative number, you should prompt him and re-take input.
For example: If the user enters 11 for size and * for symbol then the following is displayed.
If the user enters 15 for size and # for symbol then the following is displayed.
docsity.com
pf3
pf4
pf5

Partial preview of the text

Download Display of Different Things-Computer Programming-Assignment and more Exercises Computer Engineering and Programming in PDF only on Docsity!

Assignment # 2

Course No. CS Course Title Computer Programming

Due Date: Monday April 16, 2012 at 12:00pm

In this assignment you have to write a program that starts by displaying the following menu to user:

Select one of the following choices:

  1. Display an hourglass pattern
  2. Display a diamond pattern
  3. Display the Nepal flag
  4. Display the ladder pattern

When the user selects choice 1, you will ask him/her for the size of pattern and the symbol to be used in the pattern. If user enters a negative number, you should prompt him and re-take input.

For example: If the user enters 11 for size and * for symbol then the following is displayed.

If the user enters 15 for size and # for symbol then the following is displayed.

When the user selects choice 2, you will ask him/her for the size of pattern and the symbol to be used in the pattern. If user enters a negative number, you should prompt him and re-take input.

For example: If the user enters 11 for size and & for symbol then the following is displayed.

When the user selects choice 4, you will ask him/her for the size of pattern and the symbol to be used in the pattern. If user enters a negative number, you should prompt him and re-take input.

For example: If the user enters 5 for size and 3 for number of rungs and * for symbol then the following is displayed.

Allow the user to repeat the program as many number of times as he/she wants.

Your program should be properly commented and should display stuff nicely. There are marks for good coding style and readability.