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
SHOW ME SOME C++ TUTORIALS?
german
Google c++ tutorial. Cplusplus and Tutorials Point both have some good resources
4 0
4 years ago
State three (3) benefits of using the internet ​
Hoochie [10]

Answer:

  • Entertainment for everybody
  • Social network
  • Inexhaustible Education
8 0
2 years ago
Read 2 more answers
Which of the following terms means to take notes from a resource in your own words
Elan Coil [88]
Paraphrase is the correct answer
8 0
3 years ago
Read 2 more answers
When a superclass variable refers to a subclass object and a method is called on that object, the proper implementation is deter
Anni [7]

Answer:

D. Late binding

Explanation:

a. early binding.

b. non-binding.

c. on-time binding.

d. late binding.

The compiler performs a process called binding when an object is assigned to an object variable. The early binding (static binding) refers to compile time binding and late binding (dynamic binding) refers to runtime binding. Another name for late binding is dynamic linkages

It is a computer programming mechanism in which the method being called upon an object or the function being called with arguments is looked up by name at runtime.

When a superclass variable refers to a subclass object and a method is called on that object, the proper implementation is determined at execution time. The process of determining the correct method to call is known as Late Binding.

7 0
3 years ago
Read 2 more answers
Which of the following attributes of a website indicates a more reliable source for information?
kkurt [141]
The answer would be B. An attribute of a website that will indicate a more reliable source of information is when the site ends in ".edu". It is a top level domain for education. It would mean that this particular site is linked with universities, colleges or other educational sites thus it gives more information that are real and factual.
5 0
3 years ago
Other questions:
  • Sugar can be listed in many different forms except
    9·1 answer
  • What UDP port is used by a default WDS server setup when it is listening for PXE boot requests​
    12·1 answer
  • Java provides a number of interfaces and classes to systematically implement collections.
    6·1 answer
  • What do economists call a decline in the real GDP combined with a temporary rise in price level?
    8·2 answers
  • Consider an error-free 64 kbps satellite channel used to send 512 byte data frames in one direction, with very short acknowledge
    12·1 answer
  • Write a regular expression that selects lines containing any of the following words: linux windows solaris macos. For this exerc
    13·1 answer
  • What type of engineer is interested in designing, developing, and building different machines, devices, and tools? A.aerospace
    8·2 answers
  • What is one disadvantage of transmitting personal data using digital signals?
    15·2 answers
  • How to transfer word 2019 from one computer to another
    12·1 answer
  • In addition to reduced power consumption, what is an advantage of using hyperscale cloud computing data centers?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!