Make a program that will accept an arithmetic operators (either +,-,*,/ and %) and two numbers to compute. It has to display the correct answer based on the operator you enter.
Noted: Since there are 5 arithmetic operators to choose from, there should be cases followed by the default.
a. Write algorithm using pseudocode and flowchart that uses while loops to perform the
following steps:
i. Prompt the user to input two integers: firstNum and secondNum note that firstNum
must be less than secondNum.
ii. Output all odd numbers between firstNum and secondNum.
iii. Output the sum of all even numbers between firstNum and secondNum.
iv. Output the numbers and their squares between firstNum and secondNum.
v. Output the sum of the square of the odd numbers between firstNum and secondNum.
b. Redo Exercise (a) using for loops.
c. Redo Exercise (a) using do. . .while loops.
What does associativity means
The population of a town A is less than the population of town B.However, the population of
algorithmoutputs after how many years the population of town A will be greater than or equal to
flowchartthat prompts the user to enter the population and growth rate of each town. The
Population of town A =5000, growth rate of town A = 4%, populationof town B = 8000, and
town A is growing faster than the population of town B. Write algorithm usingpseudocodeand
the population of town B and the populations of both the towns at that time. (A sample input is:
growth rate of town B =2%)
Store one book data via pointer. Use function to initialize the data given by user.
Write a function named mybstmirror() that takes a reference to the root node of a binary tree and creates
a new tree (with its own nodes) that is the mirror image of the original tree. For example: if root is a reference to the root of the tree on the left below, then the return value of mybstmirror(root) would
be a reference to the root of the tree on the right below.
Node mybstmirror(Node root)
Write a program that uses loops to print out a design of following using asterisks:
* * * * *
* *
* * * * *
* * * * *
* *
* * * * *
* * * * *
* * * * *
* * * * *
* * * * *
The program should only use the following print statements:
print(“* * * * *”)
print(“* *”)
print(“\n”)
Write a program that prints the value of 120.456789 rounded to the nearest digit, tenth, hundredth, thousandth, and ten-thousandth. [Hint: This should make use of formatted output.]
Given the slope-intercept form equation, y = mx+b. Write a program that asks the user to enter values for the respective variables (m, x, and b). Use those variables to calculate the results of the equation. Then print out the values for m, x, b, and y.
Suppose that (QWERTY) is inserted into an empty bst.
Task:
Draw the diagram of bst after each insert
No need to write the code