Challenge Yourself Coding Activity The Lottery program Again Due Monday October 12th 2020 at 11:59 pm...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Challenge Yourself Coding Activity The Lottery program Again Due Monday October 12th 2020 at 11:59 pm You will make a program that creates and uses a random value as well as manipulates string and character objects in order to make a lottery game. Make sure to include your full name in a comments field. • Make sure to include your initials in the class name Hot2v1XXX where the XXX are your initials. • Make sure all instructions and outputs for the user are explicit. • First- create a single random integer named target in the range of 65-90. Prompt the user to enter their first name. Do not prompt for capitalization. Change their name to upper case. • Use the last letter of their name to convert the character to an ascil code number named guess. You will then determine if they are a winner by: o If guess is exactly the same as the target reward them with $1000. o If guess has both digits as target but in the wrong order give them $100 o If guess contains only a single digit correctly- give them $1. Otherwise tell them no luck this time. Hints: use division and remainder to create 2 individual digits from the target and then the individual digits from the guess so that you can check for the winning combinations. So if the random value is 68 a name like Spud will earn $1000 since "D" in ascii is 68, while a name like Liv will earn $100 since "V" in asci is 86 and a name like Paul earns a dollar as "L" is 76. YOU DO NOT NEED TO KNOW THE ASCII VALUES OF THE CHARACTERS, you just need to program the algorithm correctly to solve the problem! Challenge Yourself Coding Activity The Lottery program Again Due Monday October 12th 2020 at 11:59 pm You will make a program that creates and uses a random value as well as manipulates string and character objects in order to make a lottery game. Make sure to include your full name in a comments field. • Make sure to include your initials in the class name Hot2v1XXX where the XXX are your initials. • Make sure all instructions and outputs for the user are explicit. • First- create a single random integer named target in the range of 65-90. Prompt the user to enter their first name. Do not prompt for capitalization. Change their name to upper case. • Use the last letter of their name to convert the character to an ascil code number named guess. You will then determine if they are a winner by: o If guess is exactly the same as the target reward them with $1000. o If guess has both digits as target but in the wrong order give them $100 o If guess contains only a single digit correctly- give them $1. Otherwise tell them no luck this time. Hints: use division and remainder to create 2 individual digits from the target and then the individual digits from the guess so that you can check for the winning combinations. So if the random value is 68 a name like Spud will earn $1000 since "D" in ascii is 68, while a name like Liv will earn $100 since "V" in asci is 86 and a name like Paul earns a dollar as "L" is 76. YOU DO NOT NEED TO KNOW THE ASCII VALUES OF THE CHARACTERS, you just need to program the algorithm correctly to solve the problem!
Expert Answer:
Answer rating: 100% (QA)
Code import javautil class Main public static int getRando... View the full answer
Related Book For
Fundamentals of Physics
ISBN: 978-0471758013
8th Extended edition
Authors: Jearl Walker, Halliday Resnick
Posted Date:
Students also viewed these accounting questions
-
In this discussion you will make a total of two posts, including one initial post , one reply to others post and one reply to the reply to your initial post . Review the information below that...
-
You will make a judgment about the morality of poaching elephants for ivory in Africa. Here are the facts. The Great Elephant Consensus estimates that between, 410,000 - 650,000, elephants remain in...
-
Create a lottery game application. Generate three random numbers, each between 0 and 9. Allow the user to guess three numbers. Compare each of the users guesses to the three random numbers and...
-
Find the radius of convergence and interval of convergence of the series. 00 (-1)"x" n=0 n + 1
-
Using Figure, show the effect on consumer and producer surplus of the sugar import quota (relative to free trade). Also show the changes in consumer and producer surplus in RoW.
-
What is the indicated value by the sales comparison approach of a three-bedroom, two-bath home with a deck and a spa? Market research indicates that the spa and deck are worth $4,200 and a half-bath...
-
Discuss the major modes of value realization in terms of full and partial harvesting. What are the key advantages and disadvantages of each method?
-
The partners who own Cadence Canoes Co. wished to avoid the unlimited personal liability of the partnership form of business, so they incorporated as Cadence Canoes, Inc. The charter from the state...
-
DRAW ERD DIAGRAM by the data given in table AND ATTEMPT QUSETION BASED ON THAT Appendix Customer: First Name Last Name -1 Address: Street State Postal Code Interested Features Electric Automatic...
-
Alabama Atlantic is a lumber company that has three sources of wood and five markets to be supplied. The annual availability of wood at sources 1, 2, and 3 is 15, 20, and 15 million board feet,...
-
You have just found the apartment of your dreams. Before you sign the three-year lease, you have to decide how to pay your rent. Your landlord has given you three options: (1) monthly payments of...
-
How are quality of conformance and quality of design related to one another? Can a product achieve quality of design but not quality of conformance? Can the converse be true?
-
Does a product's price influence the customer's perception or expectation of a product, or both? In any of these cases, is it a positive or negative influence?
-
Which typically poses a greater challenge in designing and monitoring product qual- ity, the production of a good or provision of a service?
-
Do control charts assist in monitoring quality as conformance or quality as improvement?
-
Which is a better example of employee empowerment, a quality circle or a causal model?
-
A toy car rolls along a track, starting at the top of a ramp, then rolling down to floor level. After reaching the floor, the track contains a circular loop-the-loop with a diameter of 60 cm...
-
Swifty company is a publicly held corporation whose $1 par value stock is actively traded at $30 per share. The company issued 3400 shares of stock to acquire land recently advertised at $93000. When...
-
A track meet is held on a planet in a distant solar system. A shot-putter releases a shot at a point 2.0 m above ground level. A stroboscopic plot of the position of the shot is shown in Figure,...
-
During volcanic eruptions, chunks of solid rock can be blasted out of the volcano; these projectiles are called volcanic bombs. Figure shows a cross section of Mt. Fuji, in Japan. (a) At what initial...
-
A 3000 kg block falls vertically through 6.0 m and then collides with a 500 kg pile, driving it 3.0 cm into bedrock. Assuming that the block-pile collision is completely inelastic, find the magnitude...
-
The following data is available for a four stroke petrol engine stroke volume \(=6\) Litres. Mean effective pressure \(=6\) bar. Speed of engine \(=750\) RPM. Calculate i.p. of the engine.
-
A single cylinder, four-stroke cycle oil engine works on diesel cycle. The following readings were taken when the engine was running at full load : Calculate (a) FP of engine, (b) mechanical...
-
A six-cylinder, four-stroke petrol engine develops \(40 \mathrm{~kW}\) when running at \(3000 \mathrm{rpm}\). The volumetric efficiency at NTP is \(85 \%\). Indicated thermal efficiency is \(25 \%\)....
Study smarter with the SolutionInn App