This Question is an actual FRQ from a past exam.
A. Make all the necessary modifications
B....
Computers and Technology, 04.11.2021 14:00 Kana81
This Question is an actual FRQ from a past exam.
A. Make all the necessary modifications
B. Submit the .java file
//This question involves analyzing simulated flights a traveler might take to determine the number of points the traveler can earn.
//Travelers earn points based on the number of miles traveled.
//The points can be used for special services.
//The number of miles traveled on each simulated flight is obtained by calling the milesTraveled method in the following AirTravel class.
//You will write the methods in the class including the main method. (This part would NOT appear on the AP exam)
public class AirTravel
{
// Returns the number of miles traveled in a simulated flight.
// Assume the value returned is greater than 0.
public static int milesTraveled()
{ /* implementation not shown */ }
/** Returns the total number of points earned for numFlights flights,
* as described in part (A)
* Precondition: 0 < numFlights
*/
public static int totalPointsEarned(int numFlights)
{ /* to be implemented in part (A) */ }
// There may be variables and methods that are not shown.
}
// TASK
// (A) Write the totalPointsEarned method, which returns the total number of points earned for numFlights simulated flights.
// Miles for each simulated flight are retrieved by calling the milesTraveled method,
// which returns the number of miles traveled in one flight.
// After the miles for all of the flights have been accumulated, points are awarded
// according to the following rules:
// For the first 1,000 miles traveled, 1 point is earned per mile.
// For additional miles traveled up to 10,000 miles, 2 points are earned per mile.
// For additional miles traveled beyond 10,000 miles, 5 points are earned per mile.
// For example, for a total of 12,000 miles, a traveler earns 1,000 points for the
// first 1,000 miles, plus 2 Γ 9,000 points for miles 1,001 to 10,000, plus
// 5 Γ 2,000 points for miles 10,001 to 12,000.
// Therefore, the total number of points earned is 1,000+(2Γ9,000)+(5Γ2,000)=29,000
//
// Complete method totalPointsEarned.
// Returns the total number of points earned for numFlights flights, as described in part (A)
// Precondition: 0 < numFlights (a precondition is a condition that must be true for your method code to work)
Answers: 3
Computers and Technology, 23.06.2019 03:30
How can you repin an image on your pinterest pin board a. click on the "repin" button b. click on the "add pin" button c. click on the "upload a pin" button d. click on the "save pin" button.
Answers: 2
Computers and Technology, 24.06.2019 17:30
What is the next step if your volume does not work on computer
Answers: 2
Computers and Technology, 25.06.2019 05:10
What is the disadvantage of a mesh topology?
Answers: 1
Computers and Technology, 25.06.2019 05:30
Website hosting servers have their own unique ip address, what does this address consist of? a. numbers and letters b. numbers c. letters d. letters and symbols
Answers: 2
Chemistry, 18.03.2021 03:10
Mathematics, 18.03.2021 03:10
Health, 18.03.2021 03:10
English, 18.03.2021 03:10
Mathematics, 18.03.2021 03:10
History, 18.03.2021 03:10
Mathematics, 18.03.2021 03:10
History, 18.03.2021 03:10
Biology, 18.03.2021 03:10
Mathematics, 18.03.2021 03:10