Questions a) A bank wants to keep track of their account holder’s details for this they required account holder name, account name, account type and amount in account. As a computer programmer you are supposed to take this information for three account holders and after taking input print which account holder has greater amount in his account. (Make another program but you can use code from example discuss in class) With all previous inputs take another from user that is “Gear” that is must in range of 0 – 5, where Geer 0 means “Reverse Gear” and 1 – 4 are normal forward gears: You have to check as per following criteria user has correct speed with respect to gear. Gear Speed Comment 0 Below 10 Static Speed … “OK” Above 10 “Dangerous speed on reverse gear” 1 10 – 40 Normal Speed … “OK” 41 or above Normal Speed … “Please put next gear” 2 41 – 65 Average Speed … “OK” 66 or above Average Speed … “Please put next gear” 3 66 – 90 High Speed … “OK” 91 and above Hi Speed … “Please be careful” 4 What ever speed is “This car doesn’t has 4th gear” Write a program that will take salary of 5 employees as an input and print sum of all salaries and average of salaries inputted (using for loop)
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
PF
Questions
- a) A bank wants to keep track of their account holder’s details for this they required account holder name, account name, account type and amount in account. As a computer programmer you are supposed to take this information for three account holders and after taking input print which account holder has greater amount in his account.
- (Make another program but you can use code from example discuss in class) With all previous inputs take another from user that is “Gear” that is must in range of 0 – 5, where Geer 0 means “Reverse Gear” and 1 – 4 are normal forward gears:
You have to check as per following criteria user has correct speed with respect to gear.
Gear |
Speed |
Comment |
0 |
Below 10 |
Static Speed … “OK” |
Above 10 |
“Dangerous speed on reverse gear” |
|
1 |
10 – 40 |
Normal Speed … “OK” |
41 or above |
Normal Speed … “Please put next gear” |
|
2 |
41 – 65 |
Average Speed … “OK” |
66 or above |
Average Speed … “Please put next gear” |
|
3 |
66 – 90 |
High Speed … “OK” |
91 and above |
Hi Speed … “Please be careful” |
|
4 |
What ever speed is |
“This car doesn’t has 4th gear” |
- Write a program that will take salary of 5 employees as an input and print sum of all salaries and average of salaries inputted (using for loop)
Step by step
Solved in 3 steps with 1 images