- 🤝 I’m looking to collaborate on almost anything open-source.
- 🔨 I’m currently working on my Computer Science degree.
- 📫 How to reach me [email protected] or https://mastodon.social/@kevinBell
In the book on pp. 158 – 159 (Introduction to Programming with Java A Problem Solving Approach Second Edition by John Dean and Raymond Dean), there is code for a Bowling Scores program that works. Copy this code to a project and follow the instructions in the book to improve it. Modify the program so the calculation for the average does not perform a division by zero. The calculation and printing of the average must remain outside of the loop for collecting the input. If the user entered no valid numbers, or typed -1 as the first entry, there were no scores, so do not calculate any average. If there was no average, don't print the line that begins "Average score is". You don’t need an error message or other action, just don’t perform the calculation or print the phrase. Initialize a Boolean variable named “more” with “true”, and use it as the While loop condition. Eliminate the prompt and input before the loop (the priming input), and move the prompt and input inside the loop to the top of the loop. Use an “If-Else” structure in the loop to set “more” to “false” and skip the normal calculation if the input is negative. Add a line of output that prints the title of the project and your name first, then ask the user for bowling scores. This is the sample session with valid numbers: Ch 4 Bowling Notice that the user enters input to the right of the query, on the same line. Don’t worry if the average has lots of decimal places like this – you’ll learn how to handle that in another chapter. This is a sample with -1 as the first entry -- no valid scores were entered: Ch 4 Bowling invalid Take a screenshot of the running program matching the sample session. Run the program again and enter a different number of scores with different values, and take a screenshot of the results. Run the program again and enter -1 to quit – that will mean there are no scores so the calculation for the average will not execute and the output line for the average score will not print. Take a screenshot of the result. Pay careful attention to the rubric for this assignment. Even if not specifically mentioned in the assignment, you are responsible for the following: Use descriptive names for all variables Add comments describing the use or meaning of variables Do NOT include literal values in any calculations, always use variables Always include a header in the output with a descriptive title and your name If asking for input, make sure the user types on the same line as the question Where sample sessions are provided, output from your project must match it Note that you must use correct formatting in the code -- appropriate indentation is most important. You can use Shift-Alt-F to have NetBeans automatically format the code correctly. If the formatting is incorrect, it will be returned to you for changes with a grade of zero. Submission: the specified screenshots and the root folder for the project Note: You need to submit the whole project for these assignments. In File Explorer, go to the location where you created the project. There will be a folder with the name of your project -- that is the root folder of the project. If you submit the root folder of the project, the instructor can run it on a different machine to grade it. If you don't submit the proper folder, it won't run on another machine, and the assignment will be marked with a zero.
License: GNU General Public License v3.0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.