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
Give ways on how to effectively save.​
sp2606 [1]

Answer:

Explanation:

say goodbye to debt. Monthly debt payments are the biggest money suck when it comes to saving. ...

Cut down on groceries. ...

Cancel automatic subscriptions and memberships.

4 0
2 years ago
What is the result of expression 15 > 10 > 5 in C? What is the result of the same expression in Java?
Inessa05 [86]

Answer:

java: error

C: false

Explanation:

In Java the compiler understand that you are trying to compare an integer (15) with a boolean (10 > 5) this generate the next error:

error: bad operand types for binary operator  

In C the compiler convert (15 > 10 > 5) in (15>10) > (10>5) which is equal to TRUE > TRUE, the compiler can also read it as 1 > 1 (since 1 is TRUE and 0 is FALSE).  like 1>1 is false then C program return false.

5 0
2 years ago
Suppose you are an ISP that owns a / 22 IPv4 address block. Can you accommodate requests from six customers who need addresses f
lisabon 2012 [21]

Answer:

It is not possible.

Explanation:

In this example, we need to accommodate 473 computers for six clients that are 473 IP addresses.

For this request just we have /22 IPv4 address blocks, this mean

22 red bits 11111111111111111111110000000000 <--- 10 host bits

We must increase red bits to 25, we need these 3 bits to create 6 sub red, in this case, 2^3 = 8 sub red.

Why did we ask 3 bits? Because if we ask only 2, 2^2 = 4, and we need 6 sub red.

25 red bits 11111111111111111111111110000000 7 host bits

In this case, we need more than 260 computers, but just we have 7 bits, this means.

2^7 = 128 and just one customer needs 260, for that is impossible.

7 0
3 years ago
If you ping a device, you are using the __________ protocol.
geniusboy [140]
Internet Control Messaging Protocol

If you use the -T switch, it'll be TCP
7 0
3 years ago
Read 2 more answers
Write a brief description of what the local authorities are recommending in the news people should do to protect themselves from
lana [24]
The brief description of the local author asbestos is Hope and that's what it would too with a heart and another heart which equals 100 which equals yes
3 0
3 years ago
Other questions:
  • The negotiators past relationship will affect current behavior if the parties
    12·1 answer
  • What part of the computer gives access to the internet
    10·1 answer
  • You are going to be installing a videoconferencing system. One of the requirements of the system is that only workstations that
    10·1 answer
  • Explain what occurs when you synchronize computer and mobile devices.
    5·1 answer
  • What is a printed copy of computer output called
    10·2 answers
  • Which is better analog music or digital music
    15·2 answers
  • _KOH + _Cu(CIO3)2 - __KCIO3 +<br>_Cu(OH)2​
    12·1 answer
  • In the digital age we have less time to absorb and make sense of new information
    12·2 answers
  • Case Study
    15·1 answer
  • Photoshop files are generally small in size. True or false
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!