0% found this document useful (0 votes)
28 views

Assignment 6 - Pattern Creation

Uploaded by

Hasanul Mahi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

Assignment 6 - Pattern Creation

Uploaded by

Hasanul Mahi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Lab Assignment 6

Pattern Creation

CSE110: Programming Language I

No of Tasks Points to Score


Classwork Evaluation Homework Homework
7*10 = 70
4 2 7 Assessment
2*10 = 20

The students must complete the classwork tasks in the lab class to obtain the lab performance
marks. They will also be marked based on the assessment tasks. The lab instructors may
show/explain a few of the classwork tasks to the students if necessary. Any plagiarism in
classwork or homework will lead to the student getting zero in the entire assignment. A random
viva may take place.

You must not hard code any of the tasks, which means your code should work for any
valid user input.
Classwork

1. Take the length and width of a rectangle from the user and create the rectangle according
to the output below. Your output should match the specified output.

Sample Input #1 Sample Input #2


4 3
6 5

Output Output
1234 123
1234 123
1234 123
1234 123
1234 123
1234

2. Take the height of a left-justified right triangle from the user and create the triangle
according to the output below. Your output should match the specified output.

Sample Input #1 Sample Input #2


4 3

Output Output
1 1
12 12
123 123
1234
3. Take the height of a right-justified right triangle from the user and create the triangle
according to the output below. Your output should match the specified output.

Sample Input #1 Sample Input #2


4 3

Output Output
4 3

34 23

234 123

1234

4. Take the height of an isosceles triangle from the user and create the triangle according to
the output below. Your output should match the specified output.

Sample Input #1 Sample Input #2


4 3

Output Output

1 1
123 123
12345 12345
1234567
Evaluation

1. Take the length of a square from the user and create the square according to the output
below. Your output should match the specified output.

Sample Input #1 Sample Input #2


4 3

Output Output
1234 123
1234 123
1234 123
1234

2. Take the height of a right-justified right triangle from the user and create the triangle
according to the output below. Your output should match the specified output.

Sample Input #1 Sample Input #2


4 3

Output Output
1 1
12 12
123 123
1234
Homework

1. Take the length and width of a rectangle from the user and create a rectangle according
to the output below. Your output should match the specified output.

Sample Input #1 Sample Input #2


4 3
6 5

Output Output
4321 321
4321 321
4321 321
4321 321
4321 321
4321

2. Take the height of a palindromic isosceles triangle from the user and create the triangle
according to the output below. Your output should match the specified output.

Sample Input #1 Sample Input #2


4 3

Output Output

1 1
121 121
12321 12321
1234321

3. Take the length and width of a hollow rectangle from the user and create the rectangle
according to the output below. Your output should match the specified output.

Sample Input #1 Sample Input #2


6 3
4 5

Output Output
123456 123
1 6 1 3
1 6 1 3
123456 1 3
123

4. Take the height of a left-justified hollow right triangle from the user and create the
triangle according to the output below. Your output should match the specified output.

Sample Input #1 Sample Input #2 Sample Input #3


4 5 3

Output Output Output


1 1 1
12 12 12
1 3 1 3 123
1234 1 4
12345

5. Take the height of a hollow isosceles triangle from the user and create the triangle
according to the output below. Your output should match the specified output.

Sample Input #1 Sample Input #2 Sample Input #2


4 3 2

Output Output Output

1 1 1
1 3 1 3 123
1 5 12345
1234567
Follow the diagram of a rhombus below to answer questions 6 and 7. For these questions, you
will be taking the length of the blue marked area (user input).

6. Take the vertical diagonal length of a rhombus from the user and create the triangle
according to the output below. Your output should match the specified output.

Sample Input #1 Sample Input #2


4 3

Output Output

1 1
123 123
12345 12345
1234567 123
12345 1
123
1

7. Take the vertical diagonal length of a hollow rhombus from the user and create the
triangle according to the output below. Your output should match the specified output.

Sample Input #1 Sample Input #2


4 3

Output Output

1 1
1 3 1 3
1 5 1 5
1 7 1 3
1 5 1
1 3
1

You might also like