1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
MaRussiya [10]
2 years ago
8

Write a C program to calculate salary raise for employees. If salary is between$ 0 < $ 30000 the rate is 7.0%If salary is bet

ween$ 30000 <= $ 40000 the rate is 5.5%If salary is greater than$ 40000 the rate is 4.0%1. Let the user enter salary. Allow the user to enter as many salaries as the user wishes until the user enters a negative salary to quit. User can also decides to quite immediately after starting the program. Pick the proper loop.2. Calculate the raise, new salary, total salary, total raise, and total new salary.3. Sample input and output (leftmost column is user input): Salary Rate Raise New Salary Salary: 25000 25000.00 7.00 1750.00 26750.00 Salary: 30000 30000.00 5.50 1650.00 31650.00 Salary: 35000 35000.00 5.50 1925.00 36925.00 Salary 40000 40000.00 5.50 2200.00 42200.00 Salary: -1 Total 42200.00 7525.00 137525.00 Process returned 0 (0x0) execution time: 55.237 s Press any key to continue.
Computers and Technology
1 answer:
solmaris [256]2 years ago
5 0

Answer:

Written in C

#include <stdio.h>

int main(){

   float salary,rate,raise,newsalary,totalsalary = 0.0 ,totalraise = 0.0 ,totalnewsalary = 0.0;

   printf("Enter negative input to quit\n");

   printf("Salary: ");

   scanf("%f", &salary);

   while(salary>=0){

   if(salary>=0 && salary <30000){

       rate = 0.07;

   }

   else if(salary>=30000 && salary <=40000){

       rate = 0.055;

   }

   else{

       rate = 0.04;

   }

   

   raise = rate * salary;

   newsalary = salary + raise;

   totalraise +=raise;

   totalsalary+=salary;

   totalnewsalary+=newsalary;

   printf("Salary: %.2f\n", salary);

   printf("Rate: %.2f\n", rate);

   printf("Raise: %.2f\n", raise);

   printf("New Salary: %.2f\n", newsalary);

   printf("Salary: ");

   scanf("%f", &salary);

   }

   printf("Total Salary: %.2f\n", totalsalary);

   printf("Total New Salary: %.2f\n", totalnewsalary);

   printf("Total Raise: %.2f\n", totalraise);  

   return 0;

}

Explanation:

The declares all necessary variables as float

   float salary,rate,raise,newsalary,totalsalary = 0.0 ,totalraise = 0.0 ,totalnewsalary = 0.0;

This tells the user how to quit the program

   printf("Enter negative input to quit\n");

This prompts user for salary

   printf("Salary: ");

This gets user input

   scanf("%f", &salary);

The following iteration is repeated until user enters a negative input

   while(salary>=0){

This following if conditions check for range of salary and gets the appropriate rate of salary raise

<em>    if(salary>=0 && salary <30000){</em>

<em>        rate = 0.07;</em>

<em>    }</em>

<em>    else if(salary>=30000 && salary <=40000){</em>

<em>        rate = 0.055;</em>

<em>    }</em>

<em>    else{</em>

<em>        rate = 0.04;</em>

<em>    }    </em>

This calculates the raise by multiplying the salary by the rate of increment

   raise = rate * salary;

This calculates the new salary

   newsalary = salary + raise;

This calculates the total raise

   totalraise +=raise;

This calculates the total salary

   totalsalary+=salary;

This calculates the total new salary

   totalnewsalary+=newsalary;

This prints the salary

   printf("Salary: %.2f\n", salary);

This prints the rate of increment

   printf("Rate: %.2f\n", rate);

This prints the raise in salary

   printf("Raise: %.2f\n", raise);

This prints the new salary

   printf("New Salary: %.2f\n", newsalary);

This prompts user for salary input

   printf("Salary: ");

This gets user input for salary

   scanf("%f", &salary);

   } The while loop ends here

This prints the total salary

   printf("Total Salary: %.2f\n", totalsalary);

This prints the total new salary

   printf("Total New Salary: %.2f\n", totalnewsalary);

This prints the total raise in salary

   printf("Total Raise: %.2f\n", totalraise);  

   return 0;

You might be interested in
How did machines get involved throughout the years?
Nataliya [291]

Answer:

Although the primary goal of a political machine is keeping itself in power rather than providing good government, machines have been responsible for restructuring city governments to centralize authority, improving facilities and services, helping to assimilate immigrant groups, and encouraging the growth of business and industry. Supporters of political machines say that they “work” and that consolidating power in the hands of a boss.

Explanation:a political machine is a political group in which an authoritative leader or small group command the support of a corps of supporters and businesses

4 0
2 years ago
Which of the following did you include in your notes?
iVinArrow [24]

Answer:

How you will be innovative in what you offer

Explanation:

personally I think all 3 but it is what it is

6 0
2 years ago
You can set a ________, which is automatically displayed in a field unless the user enters something different.
Wittaler [7]

Answer:

Place holder

Explanation:

In computer programming, placeholder is a word, character or series of characters that is used to take up the space until the time when the space is actually needed. It is widely used in the sign up or login forms for web and mobile applications. For example, First Name, Last Name etc.

A programmer might have an idea that he will require this number of characters or values but he don't knows what the input will be, that’s why he uses the place holder.

Hope it helps!

6 0
3 years ago
NFPA 780, Standard for the Installation of Lightning Protection Systems provides information on the installation of _____ for li
Andrews [41]

Answer:

a and b. 250.4(A)(1) Note

Explanation:

4 0
2 years ago
What type of security solution provides a hardware platform for the storage and management of encryption keys?
shutvik [7]

The type of security solution provides a hardware platform for the storage and management of encryption keys exists hardware security modules .

Hardware security modules (HSMs) supply an effective method to control encryption keys.

<h3>What are Hardware security modules?</h3>

A hardware security module (HSM) exists as a physical machine that supplies extra security for sensitive data. This kind of device exists utilized to require cryptographic keys for essential functions such as encryption, decryption, and authentication for the usage of applications, identities, and databases.

The hardware usually costs at least USD 20,000 to deploy, USD 40,000 for increased accessibility, and multiple periods better for normal enterprise deployment.

Hardware Security Modules (HSMs) exist in hardened, tamper-resistant hardware appliances that strengthen encryption techniques by developing keys, encrypting and decrypting data, and designing and demonstrating digital signatures.

A Hardware Security Module (HSM) exists as a hardware-based protection appliance that develops, stores, and protects cryptographic keys. Sterling Secure Proxy utilizes keys and certificates stored in its store or on an HSM.

To learn more about Hardware Security Module refer to:

brainly.com/question/24118720

#SPJ4

7 0
1 year ago
Other questions:
  • What is wrong, logically, with the following code? if (x &gt; 10) System.out.println("Large"); else if (x &gt; 6 &amp;&amp; x &l
    11·1 answer
  • What is the name of a popular high-level computer programming and scripting language that is the name of a snake?
    10·1 answer
  • What is 1-7? Plz help!!!
    15·1 answer
  • Which information is considered free for use?
    9·2 answers
  • Nate wants to copy the style of his contact address to the normal template. Complete the paragraph to describe how he can access
    6·1 answer
  • Look at the following structure declaration.
    6·1 answer
  • ANYBODY WANNA PLAY FoRnITe
    11·2 answers
  • Please help i will give you brainiest and 5 stars answer the question!!!!!!!!!!!!!!!!!!!!!!!!!
    7·1 answer
  • Xercise 1<br>1.<br>What is system? Explain the components of system in brief.​
    12·1 answer
  • Which of the following is Microsoft Windows 10 virtualization technology?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!