Example:
Base integer = 3
Initial factor = 2
Number of times to process = 3
Process:
1.) 2 x 3 = 6
2.) 6 x 3 = 18
3.) 18 x 3 = 54
Therefore, the output would above would be 54.
Instructions:
Write a complete Java program illustrating the difference between instance and static members of class. Indicate with comments where each is used and explain the significance of making the instance or static. (6 marks)
Making use of object orientation write a program that stores and evaluates the total cost for items bought from a supermarket. The cashier should enter the following: - Product code, Price and Quantity. The total price should be evaluated as follows: -
Total cost = Price * Quantity
If the total cost per item is more than 20,000 there is a discount of 14% on that item and a discount of 10% on an item whose total cost is between 10,000 and 20,000. No discount is given on items whose total cost is less than 10,000
Is cybercrime rampant to PH?
Jackpot!
by CodeChum Admin
Did you know that in lotteries, a 3-digit number with the same numbers in all digits like 777 will hit the jackpot in a casino? In the same manner, let's make a program that will test if a certain 3-digit number hits a jackpot or not by identifying if all the digits of a given number is the same as the second inputted number. If it is, print "Jackpot!"; else, print "Nah".
Let's try this out now!
Input
A line containing two integers separated by a space.
777·7
Output
A line containing a string.
Jackpot!
A teacher in a class with N students has noticed that some students have formed their own groups and hence prevented intermingling of students to get those students to mix with each other, the teacher has decided a seating pattern.The seating pattern is very simplistic viz. every boy should sit next to a girl and every girl should next to a boy. They are all seated in one line. It is also mandatory that no two boys sit together, and no two girls sit together. Your task is to make the above happen with minimum number of swaps between as-is situation to desired solution
ATM PIN Code Validation
Write a function with the name validate atm.pin code that takes a word as an argument. ATM PIN is considered valid only if the given word contains Exactly 4 or 6 characters - All the characters should be digits.
Input
The input will be a single line containing a string.
Output
The output should be a single line containing either "Valid PIN Code or "Invalid PIN Code".
Explanation
For example, if the given word is "9837". the output should be "Valid PIN Code", as it contains exactly four characters and all the characters are digits.
Whereas, if the given word is "A289h4", the output should be "invalid PIN Code, though the given word contains exactly six characters, all the characters are not digits.
Write a program that prints all the uppercase characters of the ASCII character table. Display 5 characters per line. Characters are separated by exactly one space.
What is the charged of the comb afterwards