rodrickahammonds
31.05.2021 •
Computers and Technology
Bowling involves 10 frames Each frame starts with 10 pins. The bowler has two throws to knock all 10 pins down. The total score is the sum of pins knocked down, with some special rules.
For the first 9 frames
• If all 10 pins are knocked down on a frame's first throw (a strike"), that frame's score is the previous frame plus 10 plus the next two throws (No second throw is taken).
• If all 10 pins are knocked down after a frame's second throw (a "spare), that frame's score is the previous frame plus 10 plus the next throw.
In the 10th frame, if the bowler's first throw is a strike, or the first two throws yields a spare the bowler gets a third throw. The 10th frame's score is the previous frame's score plus the pins knocked down in the 10th frame's two or three throws
Given integers represents all throws for a game, output on one line each frame's score followed by a space (and end with a newline). Note that the number of throws may be as few as 11 (strikes in first 9 frames, and no strike/spare in 10th frame), or as many as 21 (2 throws in first 9 frames, then 3 in 10th).
For simplicity, the input will always have 21 integers, if the game ended with fewer than 21 throws, the remaining integeru will be O's and can be ignored.
Ex: A perfect game is one where every throw is a strike. The 21 input integers will be 10 10 10 10 10 10 10 10 10 10 10 10000000000.
The output will be: 30 60 90 120 150 180 210 240 270 300.
Hints
Ex: A perfect game is one where every throw is a strike. The 21 input integers will be 10 10 10 10 10 10 10 10 10 10 10 10000000000. The output will be 30 60 90 120 150 180 210 240 270 300.
Hints:
• A first for loop should just read in the 21 scores in the first array
• A second for loop should fill the second array's first 9 elements (first 9 frames)
• Additional code should compute the 10th frame, which is unique.
Main.java
1 import java.util.Scanner:
2
3 public class Main
4 public static void main(String[] args) {
5 Scanner schr- new Scanner(System.in);
6
7 /* Type your code here. /*
8 }
9 }
10
Solved
Show answers
More tips
- H Health and Medicine AKDS Vaccination: Ensure Your Child s Safety...
- H Health and Medicine Naskol ko Opasen Ukus Kleshcha i Kak Ego Raspoznat...
- H Health and Medicine 10 Ways to Cleanse Your Colon and Improve Your Health...
- D Dating, Love, Relationships How to Overcome Jealousy: Tips and Tricks...
- H Health and Medicine Angina: Causes, Symptoms, and Treatment...
- C Computers and Internet How to Learn to Type Fast?...
- F Food and Cooking Delight for Gourmets: How to Prepare Liver Pate...
- S Style and Beauty How to braid friendship bracelets?...
- H Health and Medicine Mercury Thermometer Danger: What to do when a thermometer breaks?...
- F Food and Cooking Which Calamari Salad is the Most Delicious?...
Answers on questions: Computers and Technology
- C Computers and Technology Help! I am completing a truth table for the following combination logic diagram and I was wondering what the black dots on the diagram mean? PLEASE let me know what...
- M Mathematics The graph below represents which of the following functions?...
- H History Which was a major cause of the great depression? a. mass production b. the rise of fascism c. the stock market crash d. the russian revolution...
- M Mathematics If you want to rent bikes for you and your friend and the bike cost $3.25 per hour how much money do you have to have for 5 hours?...
- M Mathematics What is the measure of angle ced?...
- C Chemistry To get the number of atoms in a formula, add the total subscripts?...
- E English What s the bad behind texting while driving? doing a argumentative essay on this topic and i need on it i will pick the brainliest answer that gives facts and details...
- M Mathematics In a clearance bin everything has been reduced by 75%. one item is listed in the bin for $32.40. how much was the price of the item before it was put in the clearance...
- B Biology What are the physical features of noctiluca?...
- B Biology Question 9 substances that conduct an electric current only under certain conditions are most likely to be a)metals b)nonmetals c)metalloids d)noble gases...
Ответ:
para los pueblos indigenas, el idioma no solo es un marcador de identidad y pertenencia al grupo , sino tambien el vehiculo de sus valores eticos.
la situacion de las lenguas indigenas es un reflejo de la de sus hablantes.En muchas parted del mundo , estan al borde de la extincion.
Explanation:
espero que ayude