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
jok3333 [9.3K]
2 years ago
11

Write a statement that increases numPeople by 5. Ex: If numPeople is initially 10, the output is: There are 15 people.

Engineering
1 answer:
BartSMP [9]2 years ago
8 0

Answer:

import java.util.Scanner;

public class AssigningNumberToVariable {

public static void main (String [] args) {

int numPeople;

int numPeople_inc;

numPeople = 10;

/* solution */

numPeople_inc=numPeople+5;

System.out.print("There are ");

System.out.print(numPeople_inc);

System.out.println(" people.");

}

}

Explanation:

1. Declare a new variable called: numPeople_inc

2. Add 5 each time: numPeople_inc=numPeople+5;

3. Print the answer:  numPeople_inc=numPeople+5;

Optional, just write the line in the place where says: " your solutions goes here":

numPeople = numPeople+5;

You might be interested in
8.19 - Airline Reservations System (Project Name: Airline) - A small airline has just purchased a computer for its new automated
e-lub [12.9K]

Answer:

The App is written in C++ language using dev C++.

Explanation:

/******************************************************************************

You can run this program in any C++ compiler like dev C++ or any online C++ compiler

*******************************************************************************/

#include <iostream>

using namespace std;

class bookingSeat// class for airline reservation system

{

  private:

   

   

  bool reserveSeat[10];// 10 seats (1-5) for first class and 6-10 for economy class

  int firstClassCounter=0;//count first class seat

  int economyClassCounter=5;//count economy class seat

  char seatPlacement;/* switch between economy and first clas seat----- a variable for making decision based on user input*/

  public:  

  void setFirstClassSeat()//

  {

      if(firstClassCounter<5)// first class seat should be in range of 1 to 5

      {

          reserveSeat[firstClassCounter]=1; /*set first class seat..... change index value to 1 meaning that it now it is reserved*/

          cout<<"Your First Class seat is booked and your seat no is "<<firstClassCounter+1; //display seat number reserved

          firstClassCounter++; //increament counter

      }

      else//in case seats are ful

      {

          cout<<"\nSeats are full";

          if(economyClassCounter==10 && firstClassCounter==5)

          {

              cout<<"\n Next flight leaves in 3 hours.";

          }

          else

          {

              cout<<"\nIt’s acceptable to be placed to you in the first-class section  y/n ";//take input from user

              cin>>seatPlacement;//user input

              if(seatPlacement=='y')//if customer want to reserve seat in first class

              {

                  setEconomyClassSeat();// then reserve first class seat

              }

              else

              {

                  cout<<"\n Next flight leaves in 3 hours.";

               }

               

          }

      }

       

  }

  void setEconomyClassSeat()//set economy class seat

  {

    if(economyClassCounter<10)//seat ranges between 6 and 10

      {

          reserveSeat[economyClassCounter]=1;// reserve economy class seat

          cout<<"Your Economy class seat is booked and your seat no is "<<economyClassCounter+1;//display reservation message about seat

          economyClassCounter++;//increament counter

      }

      else// if economy class seats are fulled

      {

          cout<<"\nSeats are full";

          if(economyClassCounter==10 && firstClassCounter==5)//check if all seats are booked in both classes

          {

              cout<<"\n Next flight leaves in 3 hours.";

          }

          else

          {

              cout<<"\nIt’s acceptable to be placed to you in the first-class section  y/n ";//take input from user

              cin>>seatPlacement;//user input

              if(seatPlacement=='y')//if customer want to reserve seat in first class

              {

                  setFirstClassSeat();// then reserve first class seat

              }

              else

              {

                  cout<<"\n Next flight leaves in 3 hours.";

               }

               

          }

      }

  }

   

   

};

int main()

{   int checkseat=10;// check seat

   int classType;//class type economy or first class

   bookingSeat bookseat;//object declaration of class bookingSeat

   while(checkseat<=10)//run the application until seats are fulled in both classes

   {

       cout<<"\nEnter 1 for First Class and 2 for Economy Class ";

       cin>>classType;//what user entered

       switch (classType)//decide which seat class to be reserved  

       {

           case 1://if user enter 1 then reserve first class seat

           bookseat.setFirstClassSeat();

           break;

           case 2://if user enter 2 then reserve the economy class seat

           bookseat.setEconomyClassSeat();

           

       }

       

   }

   

   return 0;

}

8 0
2 years ago
Line.
Veronika [31]

Air supplied to a pneumatic system is supplied through the C. Actuator

Explanation

Pneumatic systems are like hydraulic systems, it is just that these systems uses compressed air rather than hydraulic fluid.  Pneumatic systems are used widely across the industries. these pneumatic systems needs a constant supply of compressed air to operate. This is provided by an air compressor. The compressor sucks in air at a very high rate from the environment and stores it in a pressurized tank. the Air is supplied thereafter with the help of a actuator valve that is a more sophisticated form of a valve.

From the above statement it is clear that Air supplied to a pneumatic system is supplied through the  Actuator

7 0
3 years ago
A 100 ft long steel wire has a cross-sectional area of 0.0144 in.2. When a force of 270 lb is applied to the wire, its length in
blondinia [14]

Answer:

(a) The stress on the steel wire is 19,000 Psi

(b) The strain on the steel wire is 0.00063

(c) The modulus of elasticity of the steel is 30,000,000 Psi

Explanation:

Given;

length of steel wire, L = 100 ft

cross-sectional area, A = 0.0144 in²

applied force, F = 270 lb

extension of the wire, e = 0.75 in

<u>Part (A)</u> The stress on the steel wire;

δ = F/A

   = 270 / 0.0144

δ  = 18750 lb/in² = 19,000 Psi

<u>Part (B)</u> The strain on the steel wire;

σ = e/ L

L = 100 ft = 1200 in

σ = 0.75 / 1200

σ = 0.00063

<u>Part (C)</u> The modulus of elasticity of the steel

E = δ/σ

   = 19,000 / 0.00063

E = 30,000,000 Psi

4 0
3 years ago
A battery is an electromechanical device. a)- True b)- False
lilavasa [31]

Answer:

b)False

Explanation:

A battery is a device which store the energy in the form of chemical energy.And this stored energy is used according to the requirement.So battery is not a electromechanical device.Because it does have any mechanical component like gear ,shaft flywheel etc.

A flywheel is known as mechanical battery because it stored mechanical energy and supply that energy when more energy is required.Generally fly wheel is used during punching operation.

5 0
3 years ago
A second inventor was driving down the highway in her Prius one day with her hand out the window. She happened to be driving thr
Eva8 [605]

Answer:

Explanation:

It wouldn't work because the wind energy she would be collecting would actually come from the car engine.

The relative wind velocity observed from a moving vehicle is the sum of the actual wind velocity and the velovity of the vehicle.

u' = u + v

While running a car will generate a rather high wind velocity, and increase the power generated by a wind turbine, the turbine would only be able to convert part of the wind energy into electricity while adding a lot of drag. In the end, it would generate less energy that what the drag casuses the car to waste to move the turbine.

Regenerative braking uses an electric generator connected to the wheel axle to recover part of the kinetic energy eliminated when one brakes the vehicle. Normal brakes dissipate this energy as heat, a regenerative brake uses it to recharge a batttery. Note that is is a fraction of the energy that is recovered, not all of it.

A "regenerative accelerator" makes no sense. Braking is taking kinetic energy out of the vehicle, while accelerating is adding kinetic energy to it. Cars accelerate using the power from their engines.

6 0
3 years ago
Other questions:
  • A three-phase transformer bank consists of 3 single-phase transformers to handle 400 kVA witha 34.5kV/13.8kV voltage ratio. Find
    7·1 answer
  • A company, studying the relation between job satisfaction and length of service of employees, classified employees into three le
    14·1 answer
  • The Acme tool is aligned to the work with: A. A square B. The eye C. An Acme tool gage D. A center gage
    14·1 answer
  • What time ----–- the train arrve? ​​
    12·1 answer
  • Which option distinguishes the members of a software deployment process team most likely involved in the following scenario?
    7·1 answer
  • Sun of first 1 nayural numbers​
    7·2 answers
  • THIS IS NOT AN ACADEMIC QUESTION, but who was the bitter of 1987 in FNAF?
    6·2 answers
  • 3. Aqueous cleaners are
    11·1 answer
  • What setting do i dry my jordan max arua 2s on in the dryer <br>will mark brainliest
    8·1 answer
  • What do you think the top TWO game elements are that directly contribute to player immersion?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!