(while loop structure)
Write a short program that asks for your height in integer inches and then converts your height to feet and inches. Use a const symbolic constant to represent the conversion factor (Inches per ft). The only way to exit the program would be for height in inches be 999.
A customer pays a monthly fee of $37.50 for the telephone service and $3.50 per minute for long distance calls. Input the number of minutes for long distance calls. Calculate the total bill. Print the results and ask again. The only way to exit the program would be for number of minutes is -1. (while loop structure)
3.“OptionA” Method
Create a method called “OptionA” that will print the conversion from pounds to kilograms by calling “PoundsToKilograms” method (defined in the item #4 below) starting at 200 pounds down to 50 pounds in decrements of 5. Show the result on a table in the console.
4. “PoundsToKilograms” Method
Create a method called “PoundsToKilograms”
Create a method called “OptionA” that will print the conversion from pounds to kilograms by calling “PoundsToKilograms” method (defined in the item #4 below) starting at 200 pounds down to 50 pounds in decrements of 5. Show the result on a table in the console.
Create a SavingsAccount class. Use a static data member annualInterestRate
to store the annual interest rate for each of the savers. Each member of the class
contains a private data member savingsBalance indicating the amount the saver
currently has on deposit. Provide member function calculateMonthlyInterest
that calculates the monthly interest by multiplying the balance by
annualInterestRate divided by 12; this interest should be added to
savingsBalance. Provide a static member function modifyInterestRate that sets
the static annualInterestRate to a new value. Write a driver program to test
class SavingsAccount. Instantiate two different objects of class SavingsAccount,
saver1 and saver2, with balances of $2000.00 and $3000.00, respectively. Set
the annualInterestRate to 3 percent. Then calculate the monthly interest and
print the new balances for each of the savers. Then set the annualInterestRate to
4 percent, calculate the next month's interest and print the new balances for
each of the savers.
Write a program to determine if the given grade is within the range of 1.00 to 5.00
7)Write a Python program to count the number of characters (character frequency) in a string. without using functionConsider the following table:
State a java program that use Switch structure to print one of the above statements depending on the
selected day. Write comments to explain your code.
day statement
Monday " Monday is the first day of the week !"
Tuesday " Tuesday is the second day of the week !"
Wednesday "Wednesday is the third day of the week !"
Thursday "Thursday is the fourth day of the week !"
Friday “Friday is the fourth day of the week !"
Saturday “Saturday is the fifth day of the week !"
Sunday “Sunday is the sixth day of the week !"
Any other day “ Unknown day !"
All values in an array must be of the same data type.
A: True
B: False
Observe the following code:
const int SIZE = 3;
int nums[SIZE] = {1, 2, 3};
for (int i = 0; i <= SIZE; i++) {
std::cout << nums[i];
}
What is wrong with this code?
A: You cannot use constants with array definitions
B: The initialization list exceeds the size of the array
C: Should be i = 1 because you need to start with the first array element
D: Should be i < SIZE so that you don't access an array element that doesn't exist