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

An applicant will be accepted to the Jedi Knight Military Academy if he is at le

ID: 3868240 • Letter: A

Question


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 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

1)

#include <stdio.h>

int main(void) {

// your code goes here

int n;

printf("enter the number");

scanf("%d",&n);

if(n%2==0)

printf("The number %d is Even",n);

else

printf("The number is %d is Odd",n);

return 0;

}

Output:

Enter the number:30

The number 30 is even

2)

#include <stdio.h>

int main(void) {

// your code goes here

char w;

printf("enter the Word");

scanf("%c",&w);

if(w=='Y'||w=='y')

printf("Yes,Lets Do it");

else if(w=='N'|w=='n')

printf("No,I wont Do it");

else if(w=='M'|w=='m')

printf("May be I will");

else if(w=='S'||w=='s')

printf("Sure Dude");

return 0;

}

Output:

enter the Word:Y

Yes,Lets Do it

3)

#include <stdio.h>

int main(void) {

// your code goes here

int y;

printf("enter the Year");

scanf("%d",&y);

if(y%4==0)

printf("the year %d is Leap year",y);

else

printf("the year %d is not Leap year",y);

return 0;

}

output:

enter the Year:2004

the year 2004 is Leap year

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