revisedessays logo
  • Our services
    • Write My Essay
    • Term Paper Services
    • Research Paper Services
    • Business Plan and Case Study
    • Dissertation and Capstone project
    • Nursing Help Services
    • Online Coursework Help
    • Proofreading and Editing
    • Finance and Accounting Help
    • Programming Help Services
  • About Us
    • How it works
    • Who are we
    • FAQ
  • Pricing
  • Contact Us
  • My account
  • Order now
Order Now
Engineering

Hi I just started learning java and am having a lot of trouble with loop statements.I need a code that I can calculate the average pace of my runs.

1 min read
Posted on 
December 31st, 2021
Home Engineering Hi I just started learning java and am having a lot of trouble with loop statements.I need a code that I can calculate the average pace of my runs.
Question
Hi I just started learning java and am having a lot of trouble with loop statements.I need a code that I can calculate the average pace of my runs. I am trying to use the while statement for the code since it is required. When i try to run it, it doesnt let me put in ‘timeinminutes’. it stays stuck in the input for miles.. How do I fix this? I have researched loop statements and moving things around but suck at piecing it together. Now i cant even get it to run because it says I have an error with “;” 🙁 import static java.lang.System.*; import java.util.Scanner; import java.util.*; class averagepace { public static void main(String[] args) { Scanner scan = new Scanner(System.in); System.out.println(“Enter the miles:”); double miles = 0; double timeinminutes = 0; double avgpage = 0 while (score != -1) { time += avgpace; avgpage= scan.nextDouble(); num++; } num–; System.out.println(“The avgpace is:” + (timeinminutes/miles)); } }

Order an Essay Now & Get These Features For Free:

Turnitin Report

Formatting

Title Page

Citation

Outline

Place an Order
Share
Tweet
Share
Tweet
Calculate the price
Pages (275 words)
$0.00
revisedessays
About Us
  • How it works
  • Who are we
  • FAQ
Location
High Falls Business Center 250 Mill Street Rochester, NY 14614
© 2023 revisedessays. All rights reserved.
revisedessays will be listed as ‘revisedessays’ on your bank statement.

WhatsApp us