Hi there,

I have some questions as a beginner and I need the code of the programs below:

Q1: Write a program that removes all vowels from.

For Example: Once upon a time! becomes nc pn tm!.

Surprisingly of tell, the result is still readable

Q2: Write a program that reads a set of integers and then finds and prints the sum of even and odd integers.

Q3: Write a program that prompts the user to input a positive integer. It should then output a message indicating whether the number is prime number. (Note: An even number is prime if it is 2. An even number is prime if it is 2. An odd integer is prime if it is not divisible by any odd integer less than or equal to the square root of the number)

Q4: Write a program that uses while loops to perform the following steps:

a- Prompt the user to input two integers : firstNum and secondNum (firstNum should be less than secondNum).

b- Output all odd numbers between firstNum and secondNum.

c- Output the sum of all even numbers between firstNum and secondNum.

d- Output all numbers and their squares between 1 and 10.

e- Output the sum of the square of the odd numbers between firstNum and secondNum.

f- Output all uppercase letters.

Q5: Write a function, reverseDigit, that takes an integer as a parameter and returns the number with its digits reserved.

For Example, the value of reverseDigit(12345) is 54321; the value of reverseDigit(5600) is 65; the value of reverseDigit(7008) is 8007; and the value of reverseDigit(-532) is -235.

Q6: Write a program that prints the day number of the year, given the date in the form month-day-year.

For Example, if the input is 1-1-2006, the day number is 1; if the input is 12-25-2006 the day number is 359. The program should check for a leap year. A year is a leap year if it is divisible by 4, but not divisible by 100. For example, 1992 and 2008 are divisible by 4, but not by 100. A year that is divisible by 100 is a leap year if it is also divisible by 400. For example, 1600 and 2000 are divisible by 400.However, 1800 is not a leap year because 1800 is not divisible by 400.

Q7: Write a program to convert the time from 24-hour notation and vice versa. Your program must be menu driven, giving the user the choice of converting the time between the two notations. Furthermore your program must contain at least the following function : a function to convert the time from 24-hour notation to 12-h notation, a function to convert the time from 12-hour notation to 24-hour notation, a function to display the choices, function(s) to get the input, and function(s) to display the results. ( For 12-hour time notation, your program must display AM or PM).

Q8: Write a program that reads in a line consisting of a student's name, Social Security number, User ID, and password. The program outputs the string in which all digits of the Social Security number, and all the characters in the password are replaced by x. (The Social Security number is in the form 000-00-0000, and the user ID and the password do not contain any spaces). Your program should not use the operator [].

I hope that any one here tell me the answers of these programs.

Thanks in advance.

I have some questions as a beginner and I need the code of the programs below:

Q1: Write a program that removes all vowels from.

For Example: Once upon a time! becomes nc pn tm!.

Surprisingly of tell, the result is still readable

Q2: Write a program that reads a set of integers and then finds and prints the sum of even and odd integers.

Q3: Write a program that prompts the user to input a positive integer. It should then output a message indicating whether the number is prime number. (Note: An even number is prime if it is 2. An even number is prime if it is 2. An odd integer is prime if it is not divisible by any odd integer less than or equal to the square root of the number)

Q4: Write a program that uses while loops to perform the following steps:

a- Prompt the user to input two integers : firstNum and secondNum (firstNum should be less than secondNum).

b- Output all odd numbers between firstNum and secondNum.

c- Output the sum of all even numbers between firstNum and secondNum.

d- Output all numbers and their squares between 1 and 10.

e- Output the sum of the square of the odd numbers between firstNum and secondNum.

f- Output all uppercase letters.

Q5: Write a function, reverseDigit, that takes an integer as a parameter and returns the number with its digits reserved.

For Example, the value of reverseDigit(12345) is 54321; the value of reverseDigit(5600) is 65; the value of reverseDigit(7008) is 8007; and the value of reverseDigit(-532) is -235.

Q6: Write a program that prints the day number of the year, given the date in the form month-day-year.

For Example, if the input is 1-1-2006, the day number is 1; if the input is 12-25-2006 the day number is 359. The program should check for a leap year. A year is a leap year if it is divisible by 4, but not divisible by 100. For example, 1992 and 2008 are divisible by 4, but not by 100. A year that is divisible by 100 is a leap year if it is also divisible by 400. For example, 1600 and 2000 are divisible by 400.However, 1800 is not a leap year because 1800 is not divisible by 400.

Q7: Write a program to convert the time from 24-hour notation and vice versa. Your program must be menu driven, giving the user the choice of converting the time between the two notations. Furthermore your program must contain at least the following function : a function to convert the time from 24-hour notation to 12-h notation, a function to convert the time from 12-hour notation to 24-hour notation, a function to display the choices, function(s) to get the input, and function(s) to display the results. ( For 12-hour time notation, your program must display AM or PM).

Q8: Write a program that reads in a line consisting of a student's name, Social Security number, User ID, and password. The program outputs the string in which all digits of the Social Security number, and all the characters in the password are replaced by x. (The Social Security number is in the form 000-00-0000, and the user ID and the password do not contain any spaces). Your program should not use the operator [].

I hope that any one here tell me the answers of these programs.

Thanks in advance.

Topic archived. No new replies allowed.