subject
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)

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:00
When jen is planning to upgrade to a monitor with a better resolution, what should she be looking for in the new monitor?
Answers: 1
question
Computers and Technology, 23.06.2019 01:20
Write a function balancechemical to balance chemical reactions by solving a linear set of equations. the inputs arguments are: reagents: symbols of reagents in string row array products: symbols of products in string row array elements: elements in the reaction in string row array elcmpreag: elemental composition of reactants in two dimensional numeric array elcmpprdcts: elemental composition of prducts in two dimensional numeric array hint: the first part of the problem is setting up the set of linear equations that should be solve. the second part of the problem is to find the integers from the solution. one way to do this is to mulitiply the rational basis for the nullspace by increasing larger integers until both the left-and right-side integers exist. for example, for the reaction that involves reacting with to produce and : reagents=["ch4", "o2"]; products =["co2", "h2o"]; elements =["c","h", "o"] elcmpreag=[1,4,0;
Answers: 3
question
Computers and Technology, 24.06.2019 02:10
Consider the usual algorithm to convert an infix expression to a postfix expression. suppose that you have read 10 input characters during a conversion and that the stack now contains these symbols: (5 points) | | | + | | ( | bottom |_*_| now, suppose that you read and process the 11th symbol of the input. draw the stack for the case where the 11th symbol is
Answers: 2
question
Computers and Technology, 24.06.2019 11:00
Why is it uncommon for users to perform searches directly in database tables? a.)users are discouraged from interacting directly with tables because they might confuse tables with spreadsheets. b.) users are discouraged from interacting directly with tables because this may result in unintended changes to source data. c.)users do not have the technical skills required to perform searches directly in database tables. d.)users do not have the permissions required to perform searches directly in database tables.
Answers: 1
You know the right answer?
This Question is an actual FRQ from a past exam. A. Make all the necessary modifications
B....
Questions
question
Mathematics, 05.05.2020 23:59
question
Mathematics, 05.05.2020 23:59
question
Mathematics, 05.05.2020 23:59
question
Mathematics, 05.05.2020 23:59
question
Biology, 05.05.2020 23:59
question
Mathematics, 05.05.2020 23:59
question
Mathematics, 05.05.2020 23:59
question
Spanish, 05.05.2020 23:59
question
Mathematics, 05.05.2020 23:59
Questions on the website: 13722363