6.4.
Write a simple encryption program using string functions which apply the substitution method. Here is the given Substitution Table.
Substitution Table:
A *
E $
I /
O +
U -‐
Sample input/output dialogue:
Enter message: meet me at 9:00 a.m. in the park
Encrypted message: m$$t m$ *t 9:00 *.m. /n th$ p*rk
1 The first method to be called should ask a salesperson for the dollar value of daily sales and return the entered value to the Main() method.
2 The second method to be called should calculate the salesperson’s commission based on the rates in the following table.
Sales
Commission
$0 to $999
3%
$1000 to $2999
4%
$3000 and up
5%
5. “OptionB” Method
Create a method called “OptionB” that will print the conversion from miles to kilometres by calling “MilesToKilometers” method (defined in the item #6 below) starting at 10 miles up to 100 miles in increments of 10. Show the result on a table in the console.
6. “MilesToKilometers” Method
Create a method called “MilesToKilometers”
Task 4
Write a program that does the following for 15
students:
Reads in 3 marks for each student (you
need to ensure that only valid marks
between 0 and 100 are processed) – your
prompt message to the user should
indicate which number is being requested
(see example image of output)
Calculates and displays the highest mark
for each student.
Finds and displays the highest mark in the class.
Which of the following is not keyword in java ?
Select one:
a. import
b. package
c. volatile
d. null
What is the output of this program?
Select one:
a. 2 3 4
b. 3 2 4
c. 3 4 4
d. 3 2 3
What is the output of the following program
class TestApp {
public static void main(String[] args) {
for (int index = 0; 1; index++) {
System.out.println("Welcome");
break;
}
}
}
Select one:
A. Welcome
B. Type mismatch error
C. Run infinite-times
D. Welcome Welcome
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.
Write a program which requests a number between 1 and 50 from the user. It must repeatedly ask the user for a number until a valid number is entered. After receiving a valid number, the program must display all the even numbers smaller than that number.