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
muminat
4 years ago
8

Write a program that will produce a report showing the current and max-imum enrollments for a number of classes. Your applicatio

ns should be designed with two classes. The first class should include data members for the name of the course, current enrollment, and maximum enroll-ment. Include an instance method that returns the number of students that can still enroll in the course. The ToString() method should return the name of the course, current enrollment, and the number of open slots. In the implementation class, declare parallel arrays and do a compile-time initialization for the name of the course, current enroll-ment, and maximum enrollment. Also declare an array of class objects in your implementation class. Test your application with the following data:
Class name Current enrollment Maximum enrollment
CS150 180 200
CS250 21 30
CS270 9 20
CS300 4 20
CS350 20 20

Engineering
1 answer:
Andru [333]4 years ago
3 0

Answer:

Check the explanation

Explanation:

CODE

using System;

using System.Collections.Generic;

using System.Text;

using System.Runtime.InteropServices;

namespace listofcourses

{

   class Course1

   {

       public string coursename;

       public int courseenrol;

       public int maximum;

   }

   class Courses1

   {

       public List<Course1> colist = new List<Course1>();

       public int coursemaximum;

       public int addRecord(string num, int err,int maximum)

       {

           Course1 c1 = new Course1();

           c1.coursename = num;

           c1.courseenrol = err;

           c1.maximum=maximum;

           colist.Add(c1);

           coursemaximum = colist.Count;

           return 1;

       }

   }

class Implement

{  

static public Courses1 cos = new Courses1();

static public void printrecord()

{

           Console.WriteLine("_______________________________________________________________");

Console.WriteLine("SNo Class Name       currentEnroll MaximumEnroll");

           Console.WriteLine("_______________________________________________________________");

for (int i = 0; i < cos.coursemaximum; i++)

{

     Console.Write("{0, -5}", i + 1);

     Console.Write("{0, -19}", cos.colist[i].coursename);

     Console.Write("{0, -7}", cos.colist[i].courseenrol);

     Console.Write("{0, -7}", cos.colist[i].maximum);

     Console.WriteLine();

}

          Console.WriteLine("_______________________________________________________________");

}

static public void getRecords()

{

     Console.Write("please enter Course Name: ");

     string num;

     int c1,m1;

     num = Console.ReadLine();

            Console.Write("Enter current enrollment");

           c1= Convert.ToInt32(Console.ReadLine());

           Console.Write("Enter maximum enrollment");

           m1= Convert.ToInt32(Console.ReadLine());

     cos.addRecord(num,c1,m1);

}      

static void Main(string[] args)

{

     Console.WriteLine("Course Enrollment");

     Console.Write("please Enter the number of courses: ");

     int ncval = -1;

     string xval = Console.ReadLine();

     ncval= Convert.ToInt32(xval);

      for (int i = 1; i <= ncval; i++)

     {

           Console.WriteLine("\nEnter " + i.ToString() + " course enrollment\n");

           getRecords();

     }

    printrecord();

     char k1 = Console.ReadKey().KeyChar;

}

}

Kindly check the code output below.

You might be interested in
The Reynolds number is the major parameter that relates fluid flow momentum to friction forces. How is the Reynolds number defin
fiasKO [112]

Answer:

Reynolds number determines whether a flow is laminar or turbulent flow.

Explanation:

Reynolds number is defined as ratio of inertia force to the viscous force. it is a dimension less  number. Reynolds number is used to describe the type of flow in a fluid whether it is laminar flow or turbulent flow. Reynolds number is denoted by Re.

When Reynolds number is in the range of 0 to 2000, the flow is considered to be laminar.

When Reynolds number is in the range of 2000 to 4000, the flow is considered to be transition.

And when Reynolds number is more than 4000, the flow is turbulent flow.

                     The boundary layer thickness for a fluid is given by

                                      δ = \frac{5\times x}{\sqrt{Re}}

where δ is boundary layer thickness

           x is distance from the leading edge

           Re is Reynolds number

Thus from the above boundary layer thickness equation, we can see that the boundary layer thickness varies inversely to square root of reynolds number.

8 0
3 years ago
Two resistors, with resistances R1 and R2, are connected in series. R1 is normally distributed with mean 65 and standard deviati
Sedbober [7]

Answer:

n this question, we are asked to find the probability that  

R1 is normally distributed with mean 65  and standard deviation 10

R2 is normally distributed with mean 75  and standard deviation 5

Both resistor are connected in series.

We need to find P(R2>R1)

the we can re write as,

P(R2>R1) = P(R2-R1>R1-R1)

P(R2>R1) = P(R2-R1>0)

P(R2>R1) = P(R>0)

Where;

R = R2 - R1

Since both and are independent random variable and normally distributed, we can do the linear combinations of mean and standard deviations.

u = u2-u1

u = 75 - 65 = 10ohm

sd = √sd1² + sd2²

sd = √10²+5²

sd = √100+25 = 11.18ohm

Now we will calculate the z-score, to find  P( R>0 )

Z = ( X -u)/sd

the z score of 0 is

z = 0 - 10/11.18

z= - 0.89

4 0
4 years ago
4.54 Saturated liquid nitrogen at 600 kPa enters a boiler at a rate of 0.008 kg/s and exits as saturated vapor (see Fig. P4.54).
solmaris [256]

Answer:

hello the figure attached to your question is missing attached below is the missing diagram

answer :

i) 1.347 kW

ii) 1.6192 kW

Explanation:

Attached below is the detailed solution to the problem above

First step : Calculate for Enthalpy

h1 - hf = -3909.9 kJ/kg ( For saturated liquid nitrogen at 600 kPa )

h2- hg = -222.5 kJ/kg ( For saturated vapor nitrogen at 600 kPa )

second step : Calculate the rate of heat transfer in boiler

Q1-2 = m( h2 - h1 )  = 0.008( -222.5 -(-390.9) = 1.347 kW

step 3 : find the enthalpy of superheated Nitrogen at 600 Kpa and 280 K

from the super heated Nitrogen table

h3 = -20.1 kJ/kg

step 4 : calculate the rate of heat transfer in the super heater

Q2-3 = m ( h3 - h2 )

        = 0.008 ( -20.1 -(-222.5 ) = 1.6192 kW

6 0
3 years ago
Are currently supporting communities affected by GBV in community violations​
White raven [17]

Answer:By obey peoples propertice

Explanation:

8 0
2 years ago
Liquid flows at steady state at a rate of 2 lb/s through a pump, which operates to raise the elevation of the liquid 100 ft from
Greeley [361]

Answer:

D) 1.04 Btu/s from the liquid to the surroundings.

Explanation:

Given that:

flow rate (m) = 2 lb/s

liquid specific enthalpy at the inlet (h_{1}=40.09 Btu/lb)

liquid specific enthalpy at the exit (h_{2}=40.94 Btu/lb)

initial elevation (z_1=0ft)

final elevation (z_2=100ft)

acceleration due to gravity (g) = 32.174 ft/s²

W_{cv} = 3 Btu/s

The energy balance equation is given as:

Q_{cv}-W{cv}+m[(h_1-h_2)+(\frac{V_1^2-V_2^2}{2})+g(z_1-z_2)]=0

Since  kinetic energy effects are negligible, the equation becomes:

Q_{cv}-W{cv}+m[(h_1-h_2)+g(z_1-z_2)]=0

Substituting values:

Q_{cv}-(-3)+2[(40.09-40.94)+\frac{32.174(0-100)}{778*32.174} ]=0\\Q_{cv}+3+2[-0.85-0.1285 ]=0\\Q_{cv}+3+2(-0.9785)=0\\Q_{cv}+3-1.957=0\\Q_{cv}+1.04=0\\Q_{cv}=-1.04\\

The heat transfer rate is 1.04 Btu/s from the liquid to the surroundings.

8 0
3 years ago
Other questions:
  • The hull of a vessel develops a leak and takes on water at a rate of 57.5 gal/min. When the leak is discovered the lower deck is
    9·1 answer
  • A cruise missile under test is moving horizontally at Ma =2 in the atmosphere at an elevation of 2000 m (Air temperature is 2 °C
    5·1 answer
  • cubical tank 1 meter on each edge is filled with water at 20 degrees C. A cubical pure copper block 0.46 meters on each edge wit
    6·1 answer
  • Which type of voltage do generators produce?
    6·2 answers
  • م
    12·1 answer
  • Plz help me! I’ll mark Brainliest! :(
    11·1 answer
  • What is the total resistance of three resistors in parallel with values of 2 ohms, 4 ohms, and 4 ohms?
    12·1 answer
  • 1. A car engine transfers 3000J in 20 seconds. What is the power generated by the engine?
    5·1 answer
  • Traveling a average speed at 55mph how many miles will you travel in9 hours
    11·1 answer
  • Conclude from the scenario below which type of documentation Holly should use, and explain why this would be the best choice
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!