Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

How would I code this in C programming? NOT C++ Just C programming. Also, if pos

ID: 3815732 • Letter: H

Question

How would I code this in C programming? NOT C++ Just C programming.

Also, if possible, I would appreciate a screenshot of the code with how it looks compiled to make things easier, and to copy and paste the code text when you reply here. Please complete all of the tasks listed in the bullet points. Thank you.

Goals 1. Create a program that passes values by reference to a function Tasks Create a program that Asks the user for the starting salary and stores it in a floating point variable Asks the user for the fractional yearly raise multiplier (ex. for a salary increase of 10%, enter 0.10) Calls a function that takes the starting salary and multiplier as inputs, updates the value in the salary variable and returns the amount of additional money earned per year After the function call, print the amount of increase (i.e. returned value) and the new salary (ie. contents of the salary variable) see example below Make sure that your code compiles and runs successfully Submit your main.c C code via Blackboard Some example runs of the program are shown in the table below Enter starting salary 50000 salary increase 03 Amount of increase is 1500 New salary is 51500

Explanation / Answer

#include <stdio.h>

float raiseSalary(float salary, float increase, float *increaseAmount) {
*increaseAmount = salary * increase;
salary = salary + *increaseAmount;
return salary;
}
int main()
{
float salary, increase;
float increaseAmount;
printf("Enter starting salary: ");
scanf("%f", &salary);
printf("Enter salary increase: ");
scanf("%f", &increase);
salary = raiseSalary(salary, increase, &increaseAmount);
printf("Amount of increase is %f ", increaseAmount);
printf("New Salary is %f ", salary);
  
return 0;
}

Output:

sh-4.2$ gcc -o main *.c                                                                                                                                                                                                                                                

sh-4.2$ main                                                                                                                                                                                                                                                           

Enter starting salary: 50000                                                                                                                                                                                                                                           

Enter salary increase: .03                                                                                                                                                                                                                                             

Amount of increase is 1500.000000                                                                                                                                                                                                                                      

New Salary is 51500.000000

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote