I'm having with my C program whenever i insert numbers it keeps outputting zeros
here's the code:
#include<stdio.h>
int main(void) {
int weeklyhours;
double hourlyrate;
double grosspay;
double netpay;
double federal;
double state;
double FICA;
double Medicare;
grosspay= weeklyhours * hourlyrate;
federal = grosspay * 0.1;
state = grosspay * 0.06;
FICA = grosspay * 0.062;
Medicare = grosspay * 0.0145;
netpay = grosspay - (federal + state + FICA + Medicare);
printf("Enter the Hours per Week\n");
scanf("%d", &weeklyhours);
printf("Enter the Hourly Rate\n");
scanf("%lf", &hourlyrate);
printf("Hours per Week: %d\n", weeklyhours);
printf("Hourly Rate: %f\n", hourlyrate);
printf("Gross pay: %f\n",grosspay);
printf("State: %f\n", state);
printf("FICA: %f\n", FICA);
printf("Medicare: %f\n", Medicare);
Here's the Output:
Enter the Hours per Week
40
Enter the Hourly Rate
8
Hours per Week: 40
Hourly Rate: 8.000000
Gross pay: 0.000000
State: 0.000000
FICA: 0.000000
Medicare: 0.000000
Hey,
Note: Brother in case of any queries, just comment in box I would be very happy to assist all your queries
#include<stdio.h>
int main(void) {
int weeklyhours;
double hourlyrate;
double grosspay;
double netpay;
double federal;
double state;
double FICA;
double Medicare;
printf("Enter the Hours per Week ");
scanf("%d", &weeklyhours);
printf("Enter the Hourly Rate ");
scanf("%lf", &hourlyrate);
grosspay= (double)weeklyhours * hourlyrate;
federal = grosspay * 0.1;
state = grosspay * 0.06;
FICA = grosspay * 0.062;
Medicare = grosspay * 0.0145;
netpay = grosspay - (federal + state + FICA + Medicare);
printf("Hours per Week: %d ", weeklyhours);
printf("Hourly Rate: %f ", hourlyrate);
printf("Gross pay: %f ",grosspay);
printf("State: %f ", state);
printf("FICA: %f ", FICA);
printf("Medicare: %f ", Medicare);
return 0;
}

Kindly revert for any queries
Thanks.
I'm having with my C program whenever i insert numbers it keeps outputting zeros here's the...
I'm having trouble rounding the numbers i'm getting in my output here's my code: #include<stdio.h> int main() { char gender; float a1, a2, a3, a4, a5; float waistmeasurement, wristmeasurement, hipmeasurement, forarmmeasurement; float B, bodyweight, Bodyfat, Bodyfatpercentage; printf("This program determines the body fat of a person.Enter your gender (f|F|m|M): "); scanf("%c", &gender); printf("\n"); if(gender=='F' || gender=='f'){ printf("Enter body weight (in pounds): \n"); scanf("%f", &bodyweight); printf("Enter wrist measurement at fullest point (in inches): \n"); scanf("%f", &wristmeasurement); printf("Enter waist measurement at...
So I have a question in regards to my program. I'm learning to program in C and I was curious about the use of functions. We don't get into them in this class but I wanted to see how they work. Here is my program and I would like to create a function for each of my menu options. I created a function to display and read the menu and the option that is entered, but I would like to...
I'm having trouble understanding pointers in my c programming class. I posted the pointer assignment below. If you could leave comments pointing out where pointers are used it would be much appreciated! ----------------------------------------------------------------------------------------------------------------------------------- Write a complete C program for an automatic teller machine that dispenses money. The user should enter the amount desired (a multiple of 10 dollars) and the machine dispenses this amount using the least number of bills. The bills dispenses are 50s, 20s, and 10s. Write a...
C++ Program The Ward Bus Manufacturing Company has recently hired you to help them convert their manual payroll system to a computer-based system. Write a program to produce a 1-week payroll report for only one employee to serve as a prototype (model) for the administration to review. Input for the system will be the employee’s 4-digit ID number, the employee’s name, hours worked that week, and the employee’s hourly pay rate. Output should consist of the employee’s ID number, the...
Hey, i was just wondering how i would calculate over time pay in c++ visual studio 2017? what i have right now is either returning 0 for some reason or being skipped over? im also wondering about the federal tax as well because that also doesn't seem to work, any help is greatly appreciated! these are my variables char chChoice = ' '; int intempID = 0; int intHours = 0; int intOThours = 0; float flOTrate = 0; float...
C++ programming question will upvote
A) One of the problems that have been discussed in the class is to write a simple C++ program to determine the area and circumference of a circle of a given radius. In this lab you will be rewriting the program again but this time you will be writing some functions to take care of the user input and math. Specifically, your main function should look like the following int main //the radius of the...
I have to write a C program to assign seats on each flight of the airline’s only plane (capacity: 40 seats, in 10 rows). For the sake of simplicity, assume that each row has 4 seats labeled A, B, C, D. Your program should display the following menu of alternatives: Please type 1 for "first class" Please type 2 for "business class" Please type 3 for “economy class”. If the person types 1, then your program should assign a seat...
PLEASE HELP !
I need the journal entries, I know for sure the accounts names
for each journal is right, but not sure about the actual numbers.
(Disregard my numbers I have)
Problem 9-6AA Entries for payroll transactions LO P2, P3, P5 Francisco Company has 20 employees, each of whom earns $3,200 per month and is paid on the last day of each month. All 20 have been employed ledger ly at this amount since January 1. On March 1,...
Please help, provide source code in c++(photos attached)
develop a class called Student with the following protected
data:
name (string), id (string), units (int), gpa (double).
Public functions include:
default constructor, copy constructor, overloaded = operator,
destructor, read() to read data into it, print() to print its data,
get_name() which returns name and get_gpa() which returns the
gpa.
Derive a class called StuWorker (for student worker) from
Student with the following added data:
hours (int for hours assigned per week),...