Results 1 to 3 of 3
Hello, I cannot figure out this scripting and am desperate for help and was hoping someone can find it in their heart to help me answer these questions. 1. Declare ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 11-09-2012 #1
- Join Date
- Nov 2012
I cannot figure out this scripting and am desperate for help and was hoping someone can find it in their heart to help me answer these questions.
1. Declare a function that is called Compute_Avg. The function returns a float data, receives an integer parameter named “num”, and a float parameter named “Average”.
2. x = 2, y =1, z =3, what is the value of x, y, z after executing the following codes?
case 0: x =2; y =3;
case 1: x =3; break;
default: x=3; y=2 ;
3. Find any errors in the following function declarations.
a. int sun(int x, y);
b. int sun(int x, int y)
c. void sun(void, void) ;
d void sun(x int, y float);
4. What is the output of the code corresponding to the following pseudocode?
X = -5;
if (X > 0)
if (!((X=0) && (X<0)))
printf(“This is a new message.\n”);
void print_message( )
5. If num=5, determine whether each of the following expressions is true or false.
6. A home mortgage authority requires a deposit on a home loan according to the following schedule:
Less than $25000 6% of loan value
$25000-$49000 $1000+10% of loan
$49000-$100000 $2000+25% of loan
Loans in excess of $100000 are not allowed. Write a program that will read a loan amount and compute and print the required deposit.
7 Write a program that inputs one number, then display “yes” if num = 1, display “no” if num =2, displays “maybe” if num = 3, display “Error message” if num is not 1,2 or 3. Implement this program by a Switch statement.
8. Write a function float Average(int, int, int, int) that finds the average of four numbers, and then write a main program that inputs four numbers from the user. You need to call the function and display the mean of the four numbers in the main.
The cost of renting a tool is $20 for the first day, $10 per day for the next 3 days and $8 per day thereafter. If the input is the number of days the tool was rented, compute the cost of renting the tool.
- 11-09-2012 #2
- Join Date
- Nov 2012
I am sorry for bothering anyone for this help, but i've been sick with the flu and have fallen behind with my work. So i'd be greatful if someone can please help me with this and the shell scripting post I answered.
- 11-09-2012 #3