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
3 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]3 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
Consider a modification of the air-standard Otto cycle in which the isentropic compression and expansion processes are each repl
Ulleksa [173]

Answer:

The answers to the question are

(1) Process 1 to 2

W = 295.16 kJ/kg

Q = -73.79 kJ/kg

(2) Process 2 to 3

W = 0

Q = 1135.376 kJ/kg

(3) Process 3 to 4

W = -1049.835 kJ/kg

Q = 262.459 kJ/kg

(4) Process 4 to 3

W=0

Q = -569.09 kJ/kg

(b) The thermal efficiency = 49.9 %

(c) The mean effective pressure is 9.44 bar

Explanation:

(a) Volume compression ratio \frac{v_1}{v_2}  = 10

Initial pressure p₁ = 1 bar

Initial temperature, T₁ = 310 K

cp = 1.005 kJ/kg⋅K

Temperature T₃ = 2200 K from the isentropic chart of the Otto cycle

For a polytropic process we have

\frac{p_1}{p_2}  = (\frac{v_2}{v_1} )^n Therefore p₂ = p₁ ÷ (\frac{v_2}{v_1} )^n = (1 bar) ÷ (\frac{1}{10} )^{1.3} = 19.953 bar

Similarly for a polytropic process we have

\frac{T_1}{T_2}  = (\frac{v_2}{v_1} )^{n-1} or T₂ = T₁ ÷ (\frac{v_2}{v_1} )^{n-1} = \frac{310}{0.1^{0.3}} = 618.531 K

The molar mass of air is 28.9628 g/mol.

Therefore R = \frac{8.3145}{28.9628} = 0.287 kJ/kg⋅K

cp = 1.005 kJ/kg⋅K Therefore cv = cp - R =  1.005- 0.287 = 0.718 kJ/kg⋅K

1). For process 1 to 2 which is polytropic process we have

W = \frac{R(T_2-T_1)}{n-1} = \frac{0.287(618.531-310)}{1.3 - 1}= 295.16 kJ/kg

Q =(\frac{n-\gamma}{\gamma - 1} )W = (\frac{1.3-1.4}{1.4-1} ) 295.16 kJ/kg = -73.79 kJ/kg

W = 295.16 kJ/kg

Q = -73.79 kJ/kg

2). For process 2 to 3 which is reversible constant volume heating we have

W = 0 and Q = cv×(T₃ - T₂) = 0.718× (2200-618.531) = 1135.376 kJ/kg

W = 0

Q = 1135.376 kJ/kg

3). For process 3 to 4 which is polytropic process we have

W = \frac{R(T_4-T_3)}{n-1} = Where T₄ is given by  \frac{T_4}{T_3}  = (\frac{v_3}{v_4} )^{n-1} or T₄ = T₃ ×0.1^{0.3}

= 2200 ×0.1^{0.3}  T₄ = 1102.611 K

W =  \frac{0.287(1102.611-2200)}{1.3 - 1}= -1049.835 kJ/kg

and Q = 262.459 kJ/kg

W = -1049.835 kJ/kg

Q = 262.459 kJ/kg

4). For process 4 to 1 which is reversible constant volume cooling we have

W = 0 and Q = cv×(T₁ - T₄) = 0.718×(310 - 1102.611) = -569.09 kJ/kg

W=0

Q = -569.09 kJ/kg

(b) The thermal efficiency is given by

\eta = 1-\frac{T_4-T_1}{T_3-T_2} =1-\frac{1102.611-310}{2200-618.531} = 0.499 or 49.9 % Efficient

(c) The mean effective pressure is given by

p_{m}  = \frac{p_1r[(r^{n-1}-1)(r_p-1)]}{ (n-1)(r-1)}  where r = compression ratio and r_p = \frac{p_3}{p_2}

However p₃ = \frac{p_2T_3}{T_2} =\frac{(19.953)(2200)}{618.531} =70.97 atm

r_p = \frac{p_3}{p_2} = \frac{70.97}{19.953}  = 3.56

Therefore p_m =\frac{1*10*[(10^{0.3}-1)(3.56-1)]}{0.3*9} = 9.44 bar

Please find attached generalized diagrams of the Otto cycle

8 0
2 years ago
In this exercise, you will write a Point structure that represents a space in two-dimensional space. This Point should have both
Afina-wow [57]

Answer:

Check the explanation

Explanation:

Points to consider:

We need to take the input from the user

We need to find the manhatan distance and euclidian using the formula

(x1, y1) and (x2, y2) are the two points

Manhattan:

|x_1 - x_2| + |y_1 - y_2|

Euclidian Distance:

\sqrt{(x1 - yl)^2 + (x2 - y2)^2)}

Code

#include<stdio.h>

#include<math.h>

struct Point{

  int x, y;

};

int manhattan(Point A, Point B){

  return abs(A.x - B.x) + abs(A.y- B.y);

}

float euclidean(Point A, Point B){

  return sqrt(pow(A.x - B.x, 2) + pow(A.y - B.y, 2));

}

int main(){

  struct Point A, B;

  printf("Enter x and Y for first point: ");

  int x, y;

  scanf("%d%d", &x, &y);

  A.x = x;

  A.y = y;

  printf("Enter x and Y for second point: ");

  scanf("%d%d", &x, &y);

  B.x = x;

  B.y = y;

  printf("Manhattan Distance: %d\n", manhattan(A, B));

  printf("Euclidian Distance: %f\n", euclidean(A, B));

 

}

Sample output

8 0
3 years ago
Drag each tile to the correct box.
Trava [24]

Answer:

Bluray

DVD

CD

Explanation:

Blu ray can hold 25gb per layer

Dvd can hold 4.7GB on a single layer

Cd can hold around 737 mb

Also, dvds can go up to 2 layers

Blu ray can go up to 4

6 0
3 years ago
Can someone help me with this maze shown below.
Gnoma [55]
We can’t see the maze
3 0
2 years ago
The mechanical energy of an object is a combination of its potential energy and its
saveliy_v [14]

The mechanical energy of an object is a combination of its potential energy and its <em><u>kinetic</u></em><em><u> </u></em><em><u>energy</u></em><em><u>.</u></em>

6 0
2 years ago
Other questions:
  • An isentropic steam turbine processes 5.5 kg/s of steam at 3 MPa, which is exhausted at 50 kPa and 100°C. Five percent of this f
    13·1 answer
  • A 300 mm long steel bar with a square cross section (25 mm per edge) is pulled in tension with a load of 83,051 N , and experien
    10·1 answer
  • Tech A says that a gear set that has a drive gear with 9 teeth and a driven gear with 27 teeth has a gear ratio of 3:1. Tech B s
    7·1 answer
  • The acceleration of a point is given. a = 20 t m/s2 When t=0, s = 50 m and v = -8 m/s. What are the position and velocity of the
    13·1 answer
  • How do we need to prepare for the future?
    10·1 answer
  • A private plane pilot is what kind of individual transportation position? professional level mid-level entry-level EPA-certified
    9·1 answer
  • La Patrulla Fronteriza de los Estados Unidos analiza la compra de un helicóptero nuevo para la vigilancia aérea de la frontera d
    14·1 answer
  • How to create ground responce analysis using matlab
    6·1 answer
  • Please look at the attachments and help me with these questions
    7·1 answer
  • An agricultural manager requires
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!