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
Galina-37 [17]
3 years ago
5

This method will sell the seat in row i and column j unless it is already sold. A ticket is sold if the price of that seat in th

e array is 0. If the ticket is not sold, add the price of the seat in row i and column j to the totalSales and then set the price of that seat to 0 to designate it has been sold and return true since a sell was made. If the ticket was already sold, then return false.
Engineering
1 answer:
blsea [12.9K]3 years ago
8 0

Answer:

The solution code is written in Java.

  1. public class Movie {
  2.    private double  [][] seats = new double[5][5];
  3.    private double totalSales;
  4.    public Movie(){
  5.        for(int i= 0; i < this.seats.length; i++){
  6.            for(int j = 0; j < this.seats[i].length; j++){
  7.                this.seats[i][j] = 12;
  8.            }
  9.        }
  10.        this.totalSales = 0;
  11.    }
  12.    public boolean bookSeat(int i, int j)
  13.    {
  14.        if(this.seats[i][j] != 0){
  15.            this.totalSales += this.seats[i][j];
  16.            this.seats[i][j] = 0;
  17.            return true;
  18.        }else{
  19.            return false;
  20.        }
  21.    }
  22. }

Explanation:

The method, bookSeat(), as required by the question is presented from Line 16 - 26 as part of the public method in a class <em>Movie</em>.  This method take row,<em> i</em>, and column,<em> j</em>, as input.

By presuming the seats is an two-dimensional array with all its elements are  initialized 12 (Line 7 - 10). This means we presume the movie ticket price for all the seats are $12, for simplicity.

When the<em> bookSeat() </em>method is invoked, it will check if the current price of seats at row-i and column-i is 0. If not, the current price, will be added to the <em>totalSales </em>(Line 19)<em> </em>and then set the price to 0 (Line 20) and return <em>true</em> since the ticket is successfully sold (Line 21).  If it has already been sold, return <em>false</em> (Line 23).

You might be interested in
Chemical milling is used in an aircraft plant to create pockets in wing sections made of an aluminum alloy. The starting thickne
Lelu [443]

Answer:

a) metal removal rate is 1915.37 mm³/min

b) the time required to etch to the specified depth is 500 min or 8.333 hrs

Explanation:

Given the data in the question;

starting thickness of one work part of interest = 20 mm

depth of series of rectangular-shaped pockets = 12 mm

dimension of pocket = 200 mm by 400 mm

radius of corners of each rectangle = 15 mm

penetration rate = 0.024 mm/minute

etch factor = 1.75

a)

To get the metal removal rate MRR;

The initial area will be smaller compare to the given dimensions of 200mm by 400mm and the metal removal rate would increase during the cut as area is increased. so'

A = 200 × 400 - ( 30 × 30 - ( π × 15² ) )

= 80000 - ( 900 - 707 )      

= 80000 - 193

A = 79807 mm²

Hence, metal removal rate MRR = penetration rate × A

MRR = 0.024 mm/minute × 79807 mm²

MRR = 1915.37 mm³/min

Therefore, metal removal rate is 1915.37 mm³/min

b) To get the time required to etch to the specified depth;

Time to machine ( etch ) =  depth of series of rectangular-shaped pockets / penetration rate

we substitute

Time to machine ( etch ) = 12 mm / 0.024 mm/minute

Time to machine ( etch ) = 500 min or 8.333 hrs

Therefore, the time required to etch to the specified depth is 500 min or 8.333 hrs

3 0
3 years ago
How do you make coke for steel?
stich3 [128]
Can you be a bit more specific plz and that will let me identify the answer
6 0
3 years ago
Types of technology include:
Anastaziya [24]
The answer is D-all choices
3 0
3 years ago
List one advantage and one disadvantage of the use of the commutator?
Mariulka [41]

Answer and  Explanation:

Commutator are used in DC machine commutator is mainly used for the reversing the direction of the current .It is connected to the armature of the DC generator or motor

ADVANTAGE OF COMMUTATOR The main advantage of the commutator in DC motor is to keep keep the direction of the toque always in the same direction by changing the current direction

DISADVANTAGE OF COMMUTATOR : The main disadvantage is due to the friction between the commutator and brushes there is a friction loss.

3 0
3 years ago
The metal control joints used to relieve stresses caused by expansion and contraction in large ceiling or wall expenses in inter
timurjin [86]

Answer:

It’s called Expansion Joints

6 0
2 years ago
Other questions:
  • Now, suppose that you have a balanced stereo signal in which the left and right channels have the same voltage amplitude, 500 mV
    8·1 answer
  • Which of the two materials (brittle vs. ductile) usually obtains the highest ultimate strength and why?
    5·1 answer
  • A stainless-steel specimen from the same material characterized up above, was formed into a rectangular cross-section of dimensi
    9·1 answer
  • What would be the most likely scale factor to use for an n-gauge model train setup? (An n-gauge layout uses locomotives that are
    8·1 answer
  • How do I cancel my subscription
    12·2 answers
  • Water evaporating from a pond does so as if it were diffusing across an air film 0.15 cm thick. The diffusion coefficient of wat
    8·1 answer
  • The number of pulses per second from IGBTs is referred to as
    10·1 answer
  • 2. What is the most obvious elements of design?<br> O color<br> O shape<br> O line<br> O texture
    11·1 answer
  • A properly fitted wearable pfd should have which characteristics
    11·1 answer
  • 10. True or False? A disruptive technology<br> radically changes the way people live and<br> work.
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!