+1(316)4441378

+44-141-628-6690

Assignment

1. [prob1.c] [80%] Your computer pretends to be 20 years older than you. Create a program that asks
for your age, adds twenty years to your age, and outputs the following “smiley face”
(^_^)
Your program should output the following 5 lines:
– Line 1: Ask user to input age, and user inputs age value XX
– Line 2: Output smiley face
– Line 3: Output text, I am your computer! My name is SMILEY.
– Line 4: Output text, I am YY years old. You are 20 years younger than me.
– Line 5: Output text, See you next time. Bye!
Where XX is a user-input value and YY is a calculated value based on that user-input value.
Below is an example of your programs output, where the number 21 is users input and the number
41 is a calculated value based on that user-input value.
In your report, discuss the limitation of the input value. What happens if the user inputs a value of
the following cases?
i) A negative number (e.g. -5)
ii) An excessively large number (e.g. 9876543210)
iii) A number with decimal fraction (e.g. 15.6)
iv) An alphabet letter (e.g. A)

2. [prob2.c] [20%] Duplicate the program you created in Problem 1. Add the following modifications:
a) Prompt the user to limit the input age value between 0 and 100.
b) Add a validity check after the user has input an age value. If the user-input age value is between
0 and 100, inclusively, then the program continues. If not, the program outputs a message
notifying the user that the input is an invalid value and the program stops.
Below is an example of your programs output when the user-input age value is invalid.
In your report, discuss the effectiveness of your validity check. Does it resolve any limitation
mentioned in Problem 1?

 

You can place an order similar to this with us. You are assured of an authentic custom paper delivered within the given deadline besides our 24/7 customer support all through.

 

Latest completed orders:

# topic title discipline academic level pages delivered
6
Writer's choice
Business
University
2
1 hour 32 min
7
Wise Approach to
Philosophy
College
2
2 hours 19 min
8
1980's and 1990
History
College
3
2 hours 20 min
9
pick the best topic
Finance
School
2
2 hours 27 min
10
finance for leisure
Finance
University
12
2 hours 36 min
[order_calculator]