subject

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

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 20:10
Assume that minutes is an int variable whose value is 0 or positive. write an expression whose value is "undercooked" or "soft-boiled" or "medium-boiled" or "hard-boiled" or "overcooked" based on the value of minutes. in particular: if the value of minutes is less than 2 the expression's value is "undercooked"; 2-4 would be a "soft-boiled", 5-7 would be "medium-boiled", 8-11 would be "hard-boiled" and 12 or more would be a "overcooked".
Answers: 1
question
Computers and Technology, 22.06.2019 22:30
I'll mark brainliest if answered right! with which feature or menu option of a word processing program can you make an image like this? you can get this image using the option of a word processing program.
Answers: 1
question
Computers and Technology, 24.06.2019 04:30
Write and test a python program to find and print the largest number in a set of real (floating point) numbers. the program should first read a single positive integer number from the user, which will be how many numbers to read and search through. after reading in all of the numbers, the largest of the numbers input (not considering the count input) should be printed.
Answers: 1
question
Computers and Technology, 24.06.2019 17:50
Create a class hand in its own module. one object of class hand represents a hand of cards and so one object stores a number of card objects. for this assignment you will submit three separate modules, one with the definition of class card, one with the definition of class hand and one with the main application that thoroughly tests class hand.class hand must contain the following four methods: 1) , numcardsinhand) takes an integer as parameter and initializes a hand object with numcardsinhand card objects inside it. these card objects are generated randomly. for simplicity, assume an infinite number of decks of cards.2) bjvalue(self) returns the blackjack value for the whole hand of cards3) ) returns a string containing all the cards in the hand4) hitme(self) adds one randomly generated card to the handcreate a main program in its own module that thoroughly tests class hand. you will have three modules/files to upload to your etudes assignment submission: card.py, hand.py and the module that contains your main program.two alternatives for extra credit - you cannot get credit for both! (+1 point): after you have thoroughly tested the class hand and all of its methods, add code to your main program that stores one hand object as a pickle file and reads it back into a new hand object. you are only eligible for this extra credit if class hand has all four of the methods above working.or(+2 points): after you have thoroughly tested the class hand and all of its methods, add code to your main program that stores one hand object as a text file on the disk and reads it back into a new hand object. you are only eligible for this extra credit if class hand has all four of the methods above working.notes: -start by making any and all modifications suggested by my comments to your previous submission of class card from assignment #6 "a robust card object"-once your class card is tested and working well, you will not make any further modifications to it for the purposes of class hand.-you can keep the test code for class card intact. if it is indented inside an if __name__ == "__main__", then it will not be executed when your main program's module imports it.-to save time, write and test one method for class hand at a time.-under no circumstances are you to attempt the extra credit until you are completely finished with writing and testing all the methods in class hand.
Answers: 3
You know the right answer?
Bowling involves 10 frames Each frame starts with 10 pins. The bowler has two throws to knock all 10...
Questions
question
Biology, 18.11.2020 22:50
question
Physics, 18.11.2020 22:50
question
Business, 18.11.2020 22:50
question
Mathematics, 18.11.2020 22:50
question
Mathematics, 18.11.2020 22:50
Questions on the website: 13722363