Question

In: Computer Science

write pseudocode not c program If- else programming exercises 1.    Write a C program to find...

write pseudocode not c program

If- else programming exercises

1.    Write a C program to find maximum between two numbers.

2.    Write a C program to find maximum between three numbers.

3.    Write a C program to check whether a number is negative, positive or zero.

4.    Write a C program to check whether a number is divisible by 5 and 11 or not.

5.    Write a C program to check whether a number is even or odd.

6.    Write a C program to check whether a year is leap year or not.

7.    Write a C program to check whether a character is alphabet or not.

8.    Write a C program to input any alphabet and check whether it is vowel or consonant.

9.    Write a C program to input any character and check whether it is alphabet, digit or special character.

10.    Write a C program to check whether a character is uppercase or lowercase alphabet.

11.    Write a C program to input week number and print week day.

12.    Write a C program to input month number and print number of days in that month.

13.    Write a C program to count total number of notes in given amount.

14.    Write a C program to input angles of a triangle and check whether triangle is valid or not.

15.    Write a C program to input all sides of a triangle and check whether triangle is valid or not.

16.    Write a C program to check whether the triangle is equilateral, isosceles or scalene triangle.

17.    Write a C program to find all roots of a quadratic equation.

18.    Write a C program to calculate profit or loss.

19.    Write a C program to input marks of five subjects Physics, Chemistry, Biology, Mathematics and Computer. Calculate percentage and grade according to following:

Percentage >= 90% : Grade A

Percentage >= 80% : Grade B

Percentage >= 70% : Grade C

Percentage >= 60% : Grade D

Percentage >= 40% : Grade E

Percentage < 40% : Grade F

20.    Write a C program to input basic salary of an employee and calculate its Gross salary according to following:

Basic Salary <= 10000 : HRA = 20%, DA = 80%

Basic Salary <= 20000 : HRA = 25%, DA = 90%

Basic Salary > 20000 : HRA = 30%, DA = 95%

Solutions

Expert Solution

Answer 1
**********
READ n1,n2

IF n1>n2
   WRITE "n1 is Maximum"
ELSE
   WRITE "n2 is Maximum"
ENDIF

Answer 2
**********

READ n1,n2,n3

IF n1>n2 & n1>n3
   WRITE "n1 is Maximum"
ELSEIF n2>n1 & n2>n3
   WRITE "n2 is Maximum"
ELSE
   WRITE "n3 is Maximum"
ENDIF

Answer 3
**********
READ n1

IF n1 > 0
   WRITE "n1 is Positive"
ELSEIF n1 < 0
   WRITE "n1 is Negative"
ELSE
   WRITE "n1 is Zero"
ENDIF

Answer 4
*********

READ n1

IF (n1 % 5 =0) & (n1 % 11 = 0)
   WRITE "n1 is divisible by 5 & 11"
ELSE
   WRITE "n1 is not divisible by 5 & 11"
ENDIF

We are allowed to do only 4 exercise out of any given.

if you have any doubt then please ask me without any hesitation in the comment section below , if you like my answer then please thumbs up for the answer , before giving thumbs down please discuss the question it may possible that we may understand the question different way and we can edit and change the answers if you argue, thanks :)


Related Solutions

6. Write a program in C programming (compile and run), a pseudocode, and draw a flowchart...
6. Write a program in C programming (compile and run), a pseudocode, and draw a flowchart for each of the following problems: a) Obtain three numbers from the keyboard, compute their product and display the result. b) Obtain two numbers from the keyboard, and determine and display which (if either) is the smaller of the two numbers. c) Obtain a series of positive numbers from the keyboard, and determine and display their average (with 4 decimal points). Assume that the...
write pseudocode for the following problems not c code Pseudocode only Write a C program to...
write pseudocode for the following problems not c code Pseudocode only Write a C program to print all natural numbers from 1 to n. - using while loop Write a C program to print all natural numbers in reverse (from n to 1). - using while loop Write a C program to print all alphabets from a to z. - using while loop Write a C program to print all even numbers between 1 to 100. - using while loop...
C Program and pseudocode for this problem. Write a C program that plays the game of...
C Program and pseudocode for this problem. Write a C program that plays the game of "Guess the number" as the following: Your program choose the number to be guessed by selecting an integer at random in the rang of 1 to 1000. The program then asks the use to guess the number. If the player's guess is incorrect, your program should loop until the player finally gets the number right. Your program keeps telling the player "Too High" or...
This is for Java programming. Please use ( else if,) when writing the program) Write a...
This is for Java programming. Please use ( else if,) when writing the program) Write a java program to calculate the circumference for the triangle and the square shapes: The circumference for: Triangle = Side1 + Side2 +Sid3 Square = 4 X Side When the program executes, the user is to be presented with 2 choices. Choice 1 to calculate the circumference for the triangle Choice 2 to calculate the circumference for the square Based on the user's selection the...
Please write variables and program plan(pseudocode) of this C++ programming code: #include <iostream> using namespace std;...
Please write variables and program plan(pseudocode) of this C++ programming code: #include <iostream> using namespace std; void leapYear(int x); int main() { int x; cout << "Enter a year: "; cin >> x; leapYear (x);   return 0; } void leapYear(int x ) {    if (x % 400 == 0)    {    cout << "This is a leap Year";}    else if    ((x % 4 == 0) && (x % 100 != 0))    {    cout <<...
1. Write pseudocode for the following program. You do not have to write actual C++ code....
1. Write pseudocode for the following program. You do not have to write actual C++ code. Assume you have a text file, that has been encrypted by adding 10 to the ASCII value of each character in the message. Design a decryption program that would reverse this process, and display the original message to the console.to the new array. 2.Write the code for the specified program. Use proper style and naming. Test and upload your code as a CPP file....
Programming Assignment 1 Performance Assessment Objective: To write a C program (not C++) that calculates the...
Programming Assignment 1 Performance Assessment Objective: To write a C program (not C++) that calculates the average CPI, total processing time (T), and MIPS of a sequence of instructions, given the number of instruction classes, the CPI and total count of each instruction type, and the clock rate (frequency) of the machine. The following is what the program would look like if it were run interactively. Your program will read values without using prompts. Inputs: • Clock rate of machine...
Programming Assignment 1 Performance Assessment Objective: To write a C program (not C++) that calculates the...
Programming Assignment 1 Performance Assessment Objective: To write a C program (not C++) that calculates the average CPI, total processing time (T), and MIPS of a sequence of instructions, given the number of instruction classes, the CPI and total count of each instruction type, and the clock rate (frequency) of the machine. The following is what the program would look like if it were run interactively. Your program will read values without using prompts. Inputs: • Clock rate of machine...
For this assignment you will develop pseudocode and write a C++ program for a simple calculator....
For this assignment you will develop pseudocode and write a C++ program for a simple calculator. You will create both files in Codio. Put your pseudocode and C++ code in the files below. PSEUDOCODE FILE NAME: Calculator.txt C++ SOURCE CODE FILE NAME : Calculator.cpp DESCRIPTION: Write a menu-driven program to perform arithmetic operations and computations on a list of integer input values. Present the user with the following menu. The user will choose a menu option. The program will prompt...
1)Write a C++ program which clearly demonstrates how the dangling else ambiguity is resolved. Your program...
1)Write a C++ program which clearly demonstrates how the dangling else ambiguity is resolved. Your program should print distinct results depending on if C++ uses inner-if or outer-if resolution. Turn in a listing of your program, the output, and a description of how your program demonstrates the semantic resolution of the ambiguity. 2) Give a context-free grammar describing the syntax of the following; Non-empty strings of 0’s and 1’s that represent binary numbers that have odd parity
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT