What's new

Closed C Programming pa help

Status
Not open for further replies.

PHC-Zil

Forum Master
Elite
Joined
Nov 3, 2016
Posts
5,849
Solutions
98
Reaction
39,553
Points
5,371
Age
21
nc_ohc=Thz4MlROWg8AX-MXjZX&_nc_ht=scontent.fceb2-1.jpg


Baka pwede matulungan ako nito mag code sa C salamat
 

Attachments

C:
#include <stdio.h>
#include <stdlib.h>

int main()
{
    const float tax = 0.14, spend = 0.1, supplies = 0.01, savings = 0.25, parentspend = 0.5;
    float hours, hourrate, moneyspent, schoolsupplies, savingsbonds, parentsavingsbonds, remaining;
    float incomeb4tax, incomeaftertax;

    printf("Ente hour rate: ");
    scanf("%f", &hourrate);

    printf("Ente number of hours work: ");
    scanf("%f", &hours);

    incomeb4tax = hourrate * hours;
    printf("\nYour income before taxes from your summer job is %.2f. \n", incomeb4tax);

    incomeaftertax = incomeb4tax - (incomeb4tax * tax);
    printf("Your income after taxes from your summer job is %.2f. \n", incomeaftertax);

    moneyspent = incomeaftertax * spend;
    printf("The money you spend on clothes and the other accessories is %.2f. \n", moneyspent);

    schoolsupplies = incomeaftertax * supplies;
    printf("The money you spend in school supplies is %.2f. \n", schoolsupplies);

    savingsbonds = incomeaftertax - (moneyspent + schoolsupplies);
    remaining = savingsbonds * savings;
    printf("The money you spend buy savings bonds is %.2f. \n", remaining);

    parentsavingsbonds = remaining * parentspend;
    printf("The money your parent spend to buy additional savings bonds for you is %.2f. \n\n", parentsavingsbonds);

    system("pause");
    return 0;
}
 
Status
Not open for further replies.
Back
Top