draw the flowchart for :
1.
PseudoCode algorithm:
Declare variable of type float a,b, sum=0
Print "Enter 2 float numbers"
input a and b;
compute sum=a+b;
print sum
2.
Declare variable of type integer a, b, max
Print "Enter 2 integer numbers"
input a and b;
if a>b
max=a;
else
max=b;
print "Maximum of two is ", max;
SOLUTION:-
===========================================================================================
draw the flowchart for : 1. PseudoCode algorithm: Declare variable of type float a,b, sum=0 Print...
Q4. Write an algorithm, draw the flowchart and write a C++ program to • Read the Number and Letter from the user • Check the number and letter then print the corresponding month name as given in Table Q4 using IF ELSE STATEMENT. Table: Q4 Number and Letter Month Name JANUARY 2 F FEBRAURY 3 M MARCH 4 A APRIL Other numbers Invalid Input 1J Sample Output: Enter the value of number:1 Enter the value of letter:) JANUARY Algorithm: Flowchart:...
Q1. Write an algorithm (pseudocode or flowchart) for the following problem. Input: Eight integers Output: the sum of even numbers only. Example: Let the eight integers are 2, 9, 3, 20,5,17, 10, 6 then S = 2+20+10+6 = 38
In the pseudocode below: Function Integer perfect(Integer n) Declare Integer count = 0 Declare Integer sum = 0 While count < n Set count = count + 1 Set sum = sum + count End While Return sum End Function Function Integer perfect_sum(Integer n) Declare Integer count = 0 Declare Integer sum = 0 While count < n Set count = count + 1 Set sum = sum + perfect(count) End While Return sum End Function Module main() Display perfect_sum(5)...
I am supposed to a pseudocode function named max that accepts two integer values as arguments and returns the value that is greater of the two. Use the function in a program that prompts the user to enter two integer values. The program should display the value that is greater of the two. Is everything correct and complete? //Pseudocode //This function takes two integers as parameters: x and y Begin : Max(x,y) If(x>y) then MAX=x Else MAX=y End if Return...
Flowchart Question 1. Draw a flowchart to read five numbers and print the second maximum 2. Draw a flowchart to read five numbers and then order them from smallest number to largest number. 3. Draw a flowchart to read five numbers and then order thenm from smallest number to largest number and display the second maximum.
Flowchart Question 1. Draw a flowchart to read five numbers and print the second maximum 2. Draw a flowchart to read five numbers and then order them from smallest number to largest number. 3. Draw a flowchart to read five numbers and then order thenm from smallest number to largest number and display the second maximum.
In C code 1. Write and submit the algorithm OR flowchart to indicate you understand the problem 2. Create a project and name the source code lastname_firstname_prog5.c 3. Use the prog5.c as a guide, copy/ paste into your project source code *** build run and test, the outline code - You will need to declare an integer variable called again and initialize it 4. Add the function prototype and implement the function definition for the Greeting function 5. Add the...
Please select the output: main declare X as integer, Y as integer set x=1 set y=2 call sub(x, y) write x write y End program Subprogram sub( integer Num1 as ref, Integer Mum2 as reference) declare x as integer set Num1 = 3 set Num2 = 4 set x= 5 write x end subprogram Please select one: 5/42, 5/34, 5/32, 5/24 What is the output of this...
1.The following pseudocode algorithm is used to calculate the average of two numbers. Perform a desk check on this algorithm assuming the firstValue is 12.5 and the secondValue is 7.5. You should use a table to show your answer. L1: Program AverageCalculator; L2: Data firstValue as float; L3: Data SecondValue as float; L4: Data average as float; L5: Output “Enter the first Number”; L6: Input firstValue; L7: Output “Enter the second Number”; L8: Input secondValue; L9: average = (firstValue+secondValue)/2; L10:...
12. 10 points) Use pseudocode to write out algorithms for the following problems. (a) Assume n is any integer with n 2 7. Write out an algorithm SumofCertainIntenger in pseudocode that uses n as input variable. Use a "for" loop to compute the sum (Gk +4) (b) Assume m is any integer with m 2 5. Write out an algorithm ProductOfCertainInte- gers in pseudocode that uses m as input variable. Use a "while" loop to compute the product IT (é+4)....