6.5.
Write a simple decryption program using string functions which will apply the Substitution Method. Here is the given Substitution Table.
Substitution Table:
* A
$ E
/ I
+ O
-‐ U
Encrypted message: m$$t m$ *t 9:00 *.m. /n th$ p*rk
Decrypted message: meet me at 9:00 a.m. in the park
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
6.3.
Write a program using string function that determines if the input word is a palindrome.
A palindrome is a word that produces the same word when it is reversed.
Sample input/output dialogue:
Enter a word: AMA
Reversed: AMA “It is a palindrome”
Enter a word: STI
Reversed: ITS “It is not a palindrome
6.2.
Write a program using string functions that accepts a coded value of an item and display its equivalent tag price.
The base of the key is: 0 1 2 3 4 5 6 7 8 9 -‐-‐-‐-‐-‐
X C O M P U T E R S
Sample input/output dialogue: Enter coded value: TR.XX
Tag price: 68.00
6.1.
Write a program using standard string functions that accepts a price of an item and display its coded value.
The base of the key is: X C O M P U T E R S 1 2 3 4 5 6 7 8 9
Sample input/output dialogue: Enter price: 489.50
Coded value: PRS.UX
You are given an array of N non-negative integers: A1, A2, ..., AN. An alternating subsequence is a subsequence in which the indices of any two consecutive elements differ by exactly two in the original array. That is, if Ai1, Ai2, ..., Aik is some subsequence, then for it to be an alternating subsequence, (i2 - i1 = 2), (i3 - i2 = 2), and so on should all hold true. Among all alternating subsequences, find the one which has maximum sum of elements, and output that sum.
1. You must create a class named Bus.
2. You should also create a main class named Main.
3. In the Bus class, there should be member variables named:
-(integers) = length, capacity, speed
-(double) = fuel_capacity, fuel_burn_rate;
-(String) = name, color;
4. Create a constructor in the Bus class containing the parameters:
-name
-length
-capacity
-color
-speed
-fuel_capacity
-fuel_burn_rate
5.Create the following methods in the Bus class:
-*Must be a return method.
-*Must have a variable named result.
-*Must compute the estimated travel hour/s of a bus using the member variables fuel
-*Must compute the gas used within the given hour/s using the member variables
Write a program to compute the value of 1500+1000-450*10+300÷5
Create a short program that will print 123467.89 as currency using NumberFormat.
Sample Output:
I have ₱1,234,567.89 in my bank account.
Submit your answers by attaching a screenshot of your program's source code and its output.
Create a short program that will print 123467.89 as currency using NumberFormat.