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

Write a program that would input an integer number and then indicate whether the

ID: 3868238 • Letter: W

Question


Write a program that would input an integer number and then indicate whether the number is an even or an odd number. Write a program that would input the value of variable REPLY and the output in corresponding meaning (see below for the different values and its meaning). Write a program that would input the year and then indicate whether that year is a leap year or not. Write a program that would input a date (numeric month and day only) within 1992 and then indicate whether it is valid data or not. Income tax is computed based on the net taxable income. The income tax table is as follows: Make a program that would input the gross income and tax exemption and then output the tax due. (Net taxable income equals gross income minus tax exemption.) An applicant will be accepted to the Jedi Knight Military Academy if he is at least 200 cm. tall: age is between 21 and 25, inclusive: and a citizen of the Planet, Endor. However, if the applicant is a recommendee of Jedi Master Obi Wan, he is accepted automatically regardless of his height, age and citizenship. Write a program that would input the applicant's height, age, citizenship code ("C" for citizen of Endor, "N" for non-citizen), and recommendee code ("R" for recommendee, "N" for non-recommendee). And then output whether the applicant is accepted or rejected. Write a program that reads in a time of the day in 24-hour notation and output it in a 12-hour notation. For example, if the input is 1345, the output should be 1: 45 PM: if input is 0920, output should be 9: 20 AM. Consider 12: 00 midnight as 12: 00 AM and 12: 00 noon as 12: 00 PM.

Explanation / Answer

Important Note: Since you haven't mentioned the name of programming language, I have assumed that you need it in C programming language. But if you want the programs in some other language then mention it in the comments I will modify the programs in that language.

#include<stdio.h>

int main()

{

int num;

printf("Enter an integer: ");

scanf("%d", &num);

if(num % 2 == 0)

printf("Input number is even.");

else

printf("Input number is odd.");

}

#include<stdio.h>

int main()

{

char REPLY;

printf("Enter the REPLY value: ");

scanf("%c", &REPLY);

switch (REPLY)

{

case 'Y': printf("YES, LET'S DO IT"); break;

case 'N': printf("NO, I WON'T DO IT"); break;

case 'M': printf("MAYBE I WILL"); break;

case 'S': printf("SURE DUDE"); break;

}

}

#include<stdio.h>

int main()

{

int year;

printf("Enter the year: ");

scanf("%d", &year);

if(year % 4 == 0)

{

if(year % 100 == 0)

{

if(year % 400 == 0)

printf("The year is a leap year");

else

printf("Input year is not a leap year.");

}

else

printf("The year is a leap year");

}

else

{

printf("Input year is not a leap year.");

}

}

#include<stdio.h>

int main()

{

int day;

int month;

printf("Enter the month: ");

scanf("%d", &month);

printf("Enter the day: ");

scanf("%d", &day);

if(month == 4 || month == 6 || month == 9 || month == 11)

{

if(day >= 1 && day <= 30)

printf("Entered month and day is valid.");

else

printf("Invalid day!");

}

else if(month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12)

{

if(day >= 1 && day <= 31)

printf("Entered month and day is valid.");

else

printf("Invalid day!");

}

else if(month == 2)

{

if(day >= 1 && day <= 29)

printf("Entered month and day is valid.");

else

printf("Invalid day!");

}

else

printf("Invalid month and day combination.");

}

#include<stdio.h>

int main()

{

double income;

double exemptedAmt;

double NTI;

double tax = 0;

printf("Enter the gross income: ");

scanf("%lf", &income);

printf("Enter the tax exempted amount: ");

scanf("%lf", &exemptedAmt);

NTI = income - exemptedAmt;

if(NTI < 2500)

tax = 0;

else if(NTI >= 2500 && NTI < 5000)

tax = 100 + (3*(NTI - 2500)) / 100;

else if(NTI >= 5000 && NTI < 10000)

tax = 175 + (5*(NTI - 5000)) / 100;

else if(NTI >= 10000 && NTI < 25000)

tax = 425 + (8*(NTI - 10000)) /100;

else if(NTI >= 25000 && NTI < 50000)

tax = 1625 + (13*(NTI - 25000)) / 100;

else if(NTI >= 50000)

tax = 4875 + (25*(NTI - 50000)) / 100;

printf(" Gross income %.2lf ", income);

printf("Tax exempted income: %.2lf ", exemptedAmt);

printf("Net Taxable Income: %.2lf ", NTI);

printf(" *** The Total tax due is : %.2lf ***", tax);

}

Program #1

#include<stdio.h>

int main()

{

int num;

printf("Enter an integer: ");

scanf("%d", &num);

if(num % 2 == 0)

printf("Input number is even.");

else

printf("Input number is odd.");

}

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