Write a program that first reads an integer for the array size, then
reads numbers into the array, counts the even numbers and the odd numbers and
displays them.
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 loo
Write a menu driven program that achieves the following:
Write a program with total change amount as an integer input, and output the change using the fewest coins, one coin type per line. The coin types are Dollars, Quarters, Dimes, Nickels, and Pennies. Use singular and plural coin names as appropriate, like 1 Penny vs. 2 Pennies.
Ex: If the input is:
0 (or less than 0), the output is:
No change Ex: If the input is:
45the output is:
1 Quarter
2 Dimes Write a program whose inputs are three integers, and whose output is the smallest of the three values.
Ex: If the input is:
7 15 3the output is:
3Write a program that asks the user to enter two numbers, obtains the two numbers from the user, and prints out the sum, product, difference, quotient, and remainder of the two numbers.
Write a program c++ that has a class MathUtils which has method that perform various mathematical functions using recursion.
class MathUtils
{
public:
int factorial ( int n)
{
//to be implemented
}
int power ( int base, int exp)
{
// to be implemented
}
void triple (int[] a)
{
//to be implemented
}
}
a. The factorial method returns the factorial of the number given. Implement factorial using recursion.
b. The power method raises base to the power exp. Implement power using recursion.
c. The triple method triples every element in the given array. Implement triple using recursion, adding a helper method if necessary.
Note:
No global decelerations
Test run in main
Write a menu driven program that achieves the following:
a. Takes student’s information from the user and adds such a student into Mark Sheet.
b. Takes a student number from the user and update such a student’s information.
c. Takes a student number from the user and delete such a student from Mark Sheet.
d. Generate or re-generate individual student report files.
e. Write a short report on the approach you used to solve the problem in hand.
Qno1: Write a program that helps to find factorial,
percentage, average, Min Number, Max Number, and sort
the array in ascending and descending order. User select
the option what operation he/she wants to perform and
then enter data according to requirement.
Perform all things by using functions.
When buying a Tesla Model 3, you have a choice between three versions/trims: 1) Standard Range Plus, 2) Long Range, and 3) Performance. All trims have the same base features, but the 2nd trim includes additional features, and the 3rd trim adds features on top of those from #2. In other words, the feature list is incremental.
Write a program that asks the user to choose which Model 3 they want to buy. You will then output the feature list based on the user's selection. So that you understand which feature list belongs to each, my example below is for the most expensive trim (Performance), which includes everything. I used an empty line to separate the features for each trim. Be sure to reject invalid menu choices.