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
Mandarinka [93]
2 years ago
7

In python, how would I randomize numbers and insert them into a file?

Engineering
1 answer:
BabaBlast [244]2 years ago
7 0
Random integer values can be generated with the randint() function. This function takes two arguments: the start and the end of the range for the generated integer values. Random integers are generated within and including the start and end of range values, specifically in the interval [start, end].
You might be interested in
If 1 uF capacitor is fully charged with 120 V across it, how much energy is stored in it? (a) 7.2 kJ (b) 7.2 mJ (c) 0.12 mJ (d)
jeyben [28]

Answer:

(b) 7.2 mJ

Explanation:

ENERGY STORED IN CAPACITOR: the energy is stored in capacitor in electric field

which can be calculated by expressions

E=\frac{1}{2} c v{^2}

=\frac{1}{2} 10^{-6}120^{2}

=7200×10^{-6} J

= 7.2×10^{-3} J

=7.2 mJ

4 0
3 years ago
What is an advantage of a nuclear-fission reactor?.
Kobotan [32]

Answer:

Nuclear fission is almost 8,000 times more efficient than traditional fossil fuels at producing energy. That's a lot of energy packed into a small space. Nuclear energy is more efficient, which means it uses less fuel to power the plant and produces less waste.


advantages:
-produces no polluting gases
-does not contribute to global warming
-very low fuel costs
-Low fuel quantity reduces mining and transportation effects on environment
-High technology research required benefits other industries
-Power station has very long lifetime

Disadvantages:
-Waste is radioactive and safe disposal is very difficult and expensive
-Local thermal pollution from wastewater affects marine life
-Large-scale accidents can be catastrophic
-Public perception of nuclear power is negative
-Costs of building and safely decommissioning are very high
-Cannot react quickly to changes in electricity demand

4 0
2 years ago
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
3 years ago
A 0.19-m3 rigid tank equipped with a pressure regulator contains steam at 2 MPa and 300°C. The steam in the tank is now heated.
AVprozaik [17]

Answer:

576.21kJ

Explanation:

#We know that:

The balance mass m_{in}+m_{out}=\bigtriangleup m_{system}

so, m_e=m_1-m_2

Energy \ Balance\\E_{in}-E_{out}=\bigtriangleup E_{system}\\\\\therefore Q_i_n+m_eh_e=m_2u_2-m_1u_1

#Also, given the properties of water as;

(P_1=2Mpa,T_1=300\textdegree C)->v_1=0.12551m^3/kg,u_1=2773.2kJ/kg->h_1=3024.2kJ/kg\\\\(P_2=2Mpa,T_1=500\textdegree C)->v_2=0.17568m^3/kg,u_1=3116.9kJ/kg->h_1=3468.3kJ/kg

#We assume constant properties for the steam at average temperatures:h_e=\approx(h_1+h_2)/2

#Replace known values in the equation above;h_e=(3024.2+3468.3)/2=3246.25kJ/kg\\\\m_1=V_1/v_1=0.19m^3/(0.12551m^3/kg)=1.5138kg\\\\m_2=V_2/v_2=0.19m^3/(0.17568m^3/kg)=1.0815kg

#Using the mass and energy balance relations;

m_e=m_1-m_2\\\\m_e=1.5138-1.0815\\\\m_e=0.4323kg

#We have Q_i_n+m_eh_e=m_2u_2-m_1u_1: we replace the known values in the equation as;

Q_i_n+m_eh_e=m_2u_2-m_1u_1\\\\Q_i_n=0.4323kg\times3246.2kJ/kg+1.0815kg\times3116.9-1.5138kg\times2773.2kJ/kg\\\\Q_i_n=573.21kJ

#Hence,the amount of heat transferred when the steam temperature reaches 500°C is 576.21kJ

5 0
3 years ago
Line(s) indicates passing is allowed if there are no oncoming cars.
anygoal [31]
Broken yellow b/c you can’t pass on a double solid yellow
5 0
4 years ago
Other questions:
  • In a fluid power system, if energy is not transferred to work, what form does it take?
    6·1 answer
  • Hi, I have an assignment in which i needs to write a report on (Rationalization of electrical energy consumption) and i need cha
    6·1 answer
  • A parison is extruded from a die with outside diameter = 11.5 mm and inside diameter = 7.5 mm. The observed die swell = 1.25. Th
    8·1 answer
  • Two hemispherical shells of inner diameter 1m are joined together with 12 equally spaced bolts. If the interior pressure is rais
    15·1 answer
  • A four-lane freeway (two lanes in each direction) is located on rolling terrain and has 12-ft lanes, no lateral obstructions wit
    14·1 answer
  • Create a document that includes a constructor function named Company in the document head area. Include four properties in the C
    7·1 answer
  • Dalton needs to prepare a close-out report for his project. Which part of the close-out report would describe
    6·1 answer
  • The structure of PF3(C6H5)2 is trigonal bipyramidal, with one equatorial and two axial F atoms which interchange positions when
    15·1 answer
  • Trapezoidal screw press project
    6·1 answer
  • What is one of the most common ways in which workers get hurt around machines?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!