CSE114 labwork2 Solved

40.00 $

Description

5/5 - (1 vote)

LABWORK RULES

⚫  Name of your file should be in the format: labwork2_q#_name_surname.c

  Name: is your own name    Surname: is your own surname    #: is the question number    Example: labwork2_q1_cagri_yesil.c , labwork2_q2_cagri_yesil.c    If you do not know how to create a c file, please look at “how to run your code”

file

⚫  Your file should be on the desktop  ⚫  At 15:50, we collect your works from your desktop. Do not turn off your computer until

you are told to do so.

⚫  You will not have internet connection until we collect your works. When the access is

permitted, submit your work on coadsys.

⚫  The work we collect and you submitted on coadsys should be exactly the same.  ⚫  Read your labwork documents carefully and listen to the explanation of your assistant.   ⚫  There can be restrictions on your labwork, obey them if you want to get a full grade.   ⚫  If you did not understand the labwork or there is an unclear point, do not make  assumptions ask your assistant immediately.

⚫  There will be some example input and output for each labwork. Do not write a program  that only runs for the given example input. Be sure you understand the question well.

FORBIDDEN

⚫  Talking with your friends  ⚫  Looking at your friend’s monitor  ⚫  Using any mobile phone or smart devices  ⚫  Books, notebooks, papers or notes  ⚫ Usb or any kind of device that is used to share information  ⚫

Internet

LABWORK 2

Question 1: (50 pts)  Write a program to print the number pattern below.

Every row contains double number of columns compare to previous one. Each column contains  an integer from 1 to 9, when the number reaches 10 it restarts to 1.

The main function :

⚫  Ask the user to enter the number of rows (5 pts)  ⚫  Construct a for loop for the number of rows. (15 pts)  ⚫  Construct another for loop for the column values. (25 pts)  ⚫  Double the total number of columns before before exiting the outer loop. (5 pts)

Examples:

Question 2: (50 pts)  Write a program that asks the user to enter limited number of integers. Numbers entered can be  negative, positive or zero. Count the positive numbers, negative numbers and zeros and display  them as the output.

The main function :

⚫  Ask the user to enter the limit. (5 pts)  ⚫  Construct a while loop and get the numbers from the user. (15 pts)  ⚫  Count the positive numbers, negative numbers and zeros. (15 pts)  ⚫  Exit the loop and print the output. (15 pts)

Examples:

 

  • Labwork2-vh6eda.zip