Question: Analyze the following problems and write a program for each of them. a ) Input an integer number. If it is greater than 0 ,

Analyze the following problems and write a program for each of them.
a) Input an integer number. If it is greater than 0, find its square. Otherwise find its cube.
b) Given a value x, calculate y according to the following formula:
y={-xifx00ifx=0x2ifx>0
c) A student fails a course if s? he takes less than 50 as overall grade. Given the overall grade of a student, display whether s/he passed or failed.
d) A supermarket offers a 5% discount if your bill is more than 100 YTL. Given the customer's id number and bill, display his/her id number with the amount he/she has to pay (including the discount if any).
e) Calculate the water bill for a customer where the price of water /m3 is 3 YTL for domestic users and 2.5 YTL for industrial users. Input the user-id, consumption (amount of water used), user code (D - domestic, I - industrial), and output the user-id and the amount to be paid.
f) Given the loudness of a noice in decibels, display a perception message, using the following table:
\table[[Loudness in Decibels,Perception],[50 or lower,quiet],[51-70,intrusive],[71-90,annoying],[91-100,very annoying],[above 110,uncomfortable]]
g) Given a temperature in degrees Fahrenheit (F), convert it into degrees Centigrade (C) using the formula given in the first problem set, and output the temperature value in degrees Centigrade together with one of the messages:
\table[[Very Cold,if C is in the range [-40,0)
Analyze the following problems and write a

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!