🔒 Closed C Programming pa help

Status
Not open for further replies.

PHC-Zil

Forum Master
nc_ohc=Thz4MlROWg8AX-MXjZX&_nc_ht=scontent.fceb2-1.webp


Baka pwede matulungan ako nito mag code sa C salamat
 
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.

About this Thread

  • 1
    Replies
  • 431
    Views
  • 1
    Participants
Last reply from:
PHC-Zil

Trending Topics

Online now

Members online
1,090
Guests online
945
Total visitors
2,035

Forum statistics

Threads
2,273,795
Posts
28,951,706
Members
1,234,957
Latest member
Lawlieto
Back
Top