Write a program which can be used to calculate bonus points to given scores in the range [1..9] according to the following rules:
If the score is between 1 and 3, the bonus points is the score multiplied by 10
If the score is between 4 and 6, the bonus points is the score multiplied by 100
If the score is between 7 and 9, the bonus points is the score multiplied by 1000
For invalid scores there are no bonus points (0) Your program must make use of 2 parallel arrays – one to store the scores and the other to store the bonus points. You need to make provision for 5 scores (and bonus points) that will need to be stored.
For this program implement the following methods and use these methods in your solution (do not change the method declarations):
static void getScores(int[] scores)
static void calcBonus(int[] scores, int[] bonusPoints)
static void displayAll(int[] scores, int[] bonusPoints)
Create an enumeration named Month that holds values for the months of the year, starting with January equal to 1. Write a program that prompts the user for a month integer. Convert the user’s entry to a Month value, and display it.
Write a Python program that simulates a simple slot machine in which three numbers between 0 and 9 are randomly selected and printed side by side. The user has an initial sum of $100. The user enters his/her bet (make sure it is a valid bet, i.e., the bet is positive and less than or equal to the sum). If the three numbers are the same, the user hits the Jackpot, this means that he wins ten times his/her bet. If only two of the three numbers are the same the user wins four times his/her bet. After each round, the program outputs the sum that the user has and asks the user if he/she wish to continue playing. If yes the program repeats, else, the program displays the total winnings or losses of the user and then ends.
Create an enumeration named Month that holds values for the months of the year, starting with
January equal to 1. Write a program that prompts the user for a month integer. Convert the
user’s entry to a Month value, and display it.
Make use of methods and arrays
Create an enumeration named Month that holds values for the months of the year, starting with January equal to 1. Write a program that prompts the user for a month integer. Convert the user’s entry to a Month value, and display it.
Write a program to display the multiplication table of the input number.
Use three functions to perform the following tasks:
- Accept two integers from user. A function capture should do this using its
local variables fnum and snum.
- Modify the contents by multiplying the original values by 10. The function
modify should modify the values of fnum and snum as stated.
- Display the new value to the user. The function display should print to the
user the new values of fnum and snum variables.