Home » Computer Science Question

Computer Science Question

Assignment Requirements

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

The program for this assignment will consist of three sections, each headed

by the three-line comment below:

//*********************************************************

//****Assignment 3 Section X

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

//*********************************************************

(where X stands for the portion of the assignment to follow)

Section 1:

  1. Enter the comment with the section title.
  2. Using a while loop structure, create a loop based on a counter variable which will cycle through 10 iterations.
  3. With each iteration of the loop, request a grade from the user and add it to a running total.
  4. After the loop has ended, print to the console the overall total and the class average.
  5. Define any appropriate variables you need.

Section 2:

    Enter the comment with the section title.

  1. Create a set of two nested for loops.
  2. The outer loop will iterate from 5 to 1, decrementing by 1 with each consecutive iteration. Use the letter ‘k’ for its counter variable name.
  3. The inner loop will iterate from 0 to 10 by 2. Use the letter ‘i’ for its counter variable. Hint: Use the += operator to increment by 2.
  4. With each iteration of the inner loop, print both loop index values such as

k = 5, i = 0

Section 3:

    Enter the comment with the section title.

  1. Use a while loop to process user entered numbers.
  2. Inform the user to enter a positive number to be added to the total or -1 to end.
  3. With each iteration of the loop, add the user entered value to a running total.
  4. End the loop when the user enters -1 and do not add that value to the running total.
  5. Once the loop ends, print the total of the numbers entered, (excluding the sentinel value -1.)
  6. Define the appropriate variables needed.

POSSIBLE EXPECTED OUTPUT

Enter grade: 88

Enter grade: 78

Enter grade: 98

Enter grade: 99

Enter grade: 67

Enter grade: 78

Enter grade: 79

Enter grade: 100

Enter grade: 87

Enter grade: 56

Total of all 10 grades is 830

Class average is 83

k = 5, i = 0

k = 5, i = 2

k = 5, i = 4

k = 5, i = 6

k = 5, i = 8

k = 5, i = 10

k = 4, i = 0

k = 4, i = 2

k = 4, i = 4

k = 4, i = 6

k = 4, i = 8

k = 4, i = 10

k = 3, i = 0

k = 3, i = 2

k = 3, i = 4

k = 3, i = 6

k = 3, i = 8

k = 3, i = 10

k = 2, i = 0

k = 2, i = 2

k = 2, i = 4

k = 2, i = 6

k = 2, i = 8

k = 2, i = 10

k = 1, i = 0

k = 1, i = 2

k = 1, i = 4

k = 1, i = 6

k = 1, i = 8

k = 1, i = 10

Enter a positive number to be added to the total or -1 to end. 3

Enter a positive number to be added to the total or -1 to end. 4

Enter a positive number to be added to the total or -1 to end. 5

Enter a positive number to be added to the total or -1 to end. 8

Enter a positive number to be added to the total or -1 to end. -1

The sum of all numbers entered is 20

Directions for Submitting Your Assignment

The source code file is the file in your project that contains the code you wrote. You will only need to submit the source code file for your program and not the entire project folder or any additional project files.

Place your order
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more

Order your essay today and save 30% with the discount code ESSAYHELP