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
4 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]4 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
In the lab, the Ethernet II detail of the provided packet capture file indicated that Wireshark had determined that the ________
Norma-Jean [14]

Answer:

Type of traffic carried in the next layer

Explanation:

Ethernet II can be regarded as standard protocol, it allows capturing.

It should be noted that in the lab, the Ethernet II detail of the provided packet capture file indicated that Wireshark had determined that the Type of traffic carried in the next layer

was IPv4 multicast

4 0
3 years ago
____ rows and columns lets you keep headings on the screen as you work with the data in a large worksheet.
kipiarov [429]
"Freezing" rows <span>and columns lets you keep headings on the screen as you work with the data in a large worksheet.
</span><span>
The important point to consider is that you can freeze only rows at the top and columns on the left side of the worksheet and you cannot freeze in the middle of worksheet.The Freeze Panes summon isn't accessible when you're in cell altering mode (that is, you're entering an equation or information in a cell) or when a worksheet is ensured. To scratch off cell altering mode, press Enter or Esc. 
when you are going to freeze both rows and columns, you have to freeze them at the same time.</span>
3 0
3 years ago
Read 2 more answers
There are well-known classes of problems that are intractably difficult for computers, and other classes that are provably undec
Wittaler [7]
No. It is not impossible to understand and make this algorithm a success. It may only take a longer duration to reach success but it does not that it is impossible. Problems may become more difficult to understand and debug but there is enough time, duration, resources and support, the algorithm can be developed.
4 0
3 years ago
Consider a relation about people in the United States, including their name, Social Security number, street address, city, state
andreyandreev [35.5K]

Answer:

For constructing relational schema, consider the relation as:

Data Attributes for USPeople: name, Social Security number (SSN), street address, city, state,

ZIP code, area code, phone number

1. Functional Dependency (FD):

A functional dependency (FD) is a relationship between the primary key and non-key attributes of  the relation. For finding FD, we need to know about the primary key (PK) which should be unique.

Social Security number (SSN) is the only attribute that holds unique value for relation. R, attribute for any relation Y is functionally dependent on attribute X (usually the PK), if for every  valid instance of X, that value of X uniquely determines the value of Y.

Social Security number (PK) ->;name, street address, city, state, ZIP code, area code, phone  number

2. keys for the relation

Primary key = Social Security Number (PK)

Foreign key = Area code

In the normalization process, we can separate address table (street address, city, state, ZIP  code, area code)

Can an area code straddle two states?

Yes, it can straddle between two states; it might be in cities/regions that “lie” across two states.  For example, Kansas City is in Missouri and Kansas. A lot of people share the same area code.

Can a ZIP code straddle two area codes?

Yes, it can straddle between two states; it might be in cities/regions that “lie” across two states.

Can same Social Security number is allotted to two people?

NO, everyone has a unique SSN number.

Can peoples living together have the same address or phone number?

Yes, people living in the same house share addresses or phone numbers.

4 0
3 years ago
Advertising managers work on websites used in __________?
Elena-2011 [213]
Campaigns

Hope this is right :-;
3 0
3 years ago
Read 2 more answers
Other questions:
  • ​​most code division multiple access (cdma) networks conform to ____________ , created by the telecommunications industry associ
    10·1 answer
  • What standard linux utility is used to install and configure software on centos operating systems?
    8·1 answer
  • A result of the Gibbons v. Ogden (1824) decision was that states​
    11·1 answer
  • What is the code for loading image in matlab
    15·1 answer
  • Which tab is used to edit objects on the slide master and layouts
    10·1 answer
  • The algorithm ADDN implements N-bit fixed-width binary addition for non-negative integers and ignores overflows. For example, AD
    13·1 answer
  • Egovernment involves the use of strategies and technologies to transform government by improving the delivery of services and en
    7·1 answer
  • In the following code, what values could be read into number to terminate the while loop? Scanner keyboard = new Scanner(System.
    8·1 answer
  • Given the following code fragment and the input value of 4.0, what output is generated?
    8·1 answer
  • Write a for loop to print all elements in courseGrades, following each element with a space (including the last). Print forwards
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!