1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
hjlf
3 years ago
10

You have been hired by Beta Airlines to help them with their flight prices. You are to create a 10 x 10 2D array (also called a

matrix) that holds the prices of their domestic flights between Atlanta and Hawaii. Your program should fill the matrix with random values between $99 and $1999 and allow a user to enter a price that matches their preferred cost for the flight. You should then process the 2D array and return whether or not a price in the array matches their requested price (exactly matches).
Computers and Technology
1 answer:
AveGali [126]3 years ago
4 0

Answer:

See explaination

Explanation:

//Array to store prices

INT PRICE[10][10]

//Loop through 2d array

FOR I FROM 0 TO 10

FOR J FROM 0 TO 10

//Populate a random int

PRICE[I][J] = RANDOM_INT(99,1999)

PRINT(PRICE[I][J]+" ")

PRINT()

//Prompt user for desired price

COST = READ_INPUT('Please enter your desired flight price: ')

//Variable to store if a match is found

MATCH = FALSE

//Loop through all ints in price

FOR I FROM 0 TO 10

FOR J FROM 0 TO 10

//Compare price with Cost

IF PRICE[I][J]==COST

MATCH = TRUE

BREAK

//Check if match is true

IF MATCH = TRUE

PRINT('A flight was found for that price, have a safe trip!')

ELSE

PRINT('No flight was found for that price, please try a new price.')

You might be interested in
Which of the following is a basic concept associated with Web 2.0? Select one: a. shift in user's role from the passive consumer
soldier1979 [14.2K]

Answer:

A: shift in user's role from the passive consumer of content to its creator

Explanation:

During the phase of Web 2.0, consumers evolved from just been highly informed and socially connected (in other words, they evolved from being just passive consumers) to a more engaged and empowered consumer. This implied that consumers could easily adapt to new technologies to meet individual needs and create an emotional bond with brands. They evolved from passive consumers to being the creators of what they wanted to meet their specific needs.

5 0
3 years ago
Five features of any window​
Vesna [10]

Answer:

The features of any windows are

1. Start menu

2. Notification area or task bar

3. Window snipping tools

4. Using Local Area Networks

5. Windows explorer libraries

Explanation:

8 0
2 years ago
Mel is a research scientist at a health sciences center. His job requires him to analyze large amounts of data in short periods
blondinia [14]

In the case above, Mel needs a  desktop computer with a fast processor.

<h3>What is data for a computer?</h3>

Computer data is known to be a form of information processed or saved by a computer. This information is saved as text documents, images, audio clips, software programs and others.

Hence due to the volume of work and in In the case above, Mel needs a  desktop computer with a fast processor.

See options below

23

Mel is a research scientist at a health sciences center. His job requires him to analyze large amounts of data in short periods of time.

Select the best computer for Mel.



A handheld tablet computer



A desktop computer with two screens



A desktop computer with a fast processor



A portable laptop computer

Learn more about data  from

brainly.com/question/19243813

#SPJ1

4 0
1 year ago
One property of light that makes it possible to record the image of an object with the camera
KengaRu [80]

Answer:

Reflection

Explanation:

Reflection is the property of light in which when a ray of light hits a smooth surface, it bounces back in the direction in which it came from. If i is the angle between the normal to the surface and the incident ray, and r is the angle between the normal and reflected ray, the law of reflection states that the angle of incidence equals the angle of reflection. That is, i = r.

So, to record the image of an object with a camera, one property of light that makes that possible is reflection because, the incidence rays form an image of the object in the camera, while the reflected rays reflect the image so that it is visible to the eye.

7 0
3 years ago
A recursive method may call other methods, including calling itself. Creating a recursive method can be accomplished in two step
liq [111]

Answer:

Explanation:

The following code is written in Java. It creates the raiseToPower method that takes in two int parameters. It then uses recursion to calculate the value of the first parameter raised to the power of the second parameter. Three test cases have been provided in the main method of the program and the output can be seen in the attached image below.

class Brainly {

   public static void main(String[] args) {

       System.out.println("Base 5, Exponent 3: " + raiseToPower(5,3));

       System.out.println("Base 2, Exponent 7: " + raiseToPower(2,7));

       System.out.println("Base 5, Exponent 9: " + raiseToPower(5,9));

   }

   public static int raiseToPower(int base, int exponent) {

       if (exponent == 0) {

           return 1;

       } else if (exponent == 1) {

           return base;

       } else {

           return (base * raiseToPower(base, exponent-1));

       }

   }

 

}

4 0
2 years ago
Other questions:
  • in what way do rules and laws created to address public problems affect individuals groups and business
    13·1 answer
  • You manage a small LAN for a branch office. The branch office has three file servers and few client workstations. You want to us
    14·1 answer
  • The set of rules for how computers talk to one another
    6·1 answer
  • Which components of the​ five-component model is commonly thought of as the​ "bridge" that links the computer side of the model
    13·1 answer
  • In java please
    13·1 answer
  • Stephanie would like to know the average number of regular hours worked by her employees. In cell B11, create a formula using th
    8·1 answer
  • If Anyone can help me out that'll be great
    11·1 answer
  • What are some best practices for file management
    8·1 answer
  • true or false? multimedia components such as audio and video do not significantly contribute to increased computer network traff
    15·1 answer
  • Do you guys answer questions about cyber security?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!