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
Find: factor of safety (n)for point A and B by using both MSS and DE (you can neglect shear stress due to shear force and also n
gladu [14]

Answer:

Hello your question is incomplete attached below is the complete question

Answer : Factor of safety for point A :

i) using MSS

(Fos)MSS =  3.22

ii) using DE

(Fos)DE = 3.27

Factor of safety for point B

i) using MSS

(Fos)MSS =  3.04

ii) using DE

(Fos)DE = 3.604

Explanation:

Factor of safety for point A :

i) using MSS

(Fos)MSS =  3.22

ii) using DE

(Fos)DE = 3.27

Factor of safety for point B

i) using MSS

(Fos)MSS =  3.04

ii) using DE

(Fos)DE = 3.604

Attached below is the detailed solution

8 0
3 years ago
A 2-bit positive-edge triggered register has data inputs d1, d0, clock input clk, and outputs q1, q0. Data inputs d1d0 are 01 an
ale4655 [162]

Answer:

  q1q1 ⇒ 01

Explanation:

The outputs of a positive edge triggered register will match the inputs after a rising clock edge.

  q1q1 ⇒ 01 . . . . matching d1d0 = 01

7 0
3 years ago
A sinusoidal wave of frequency 420 Hz has a speed of 310 m/s. (a) How far apart are two points that differ in phase by π/8 rad?
Olin [163]

Answer:

a) Two points that differ in phase by π/8 rad are 0.0461 m apart.

b) The phase difference between two displacements at a certain point at times 1.6 ms apart is 4π/3.

Explanation:

f = 420 Hz, v = 310 m/s, λ = wavelength = ?

v = fλ

λ = v/f = 310/420 = 0.738 m

T = periodic time of the wave = 1/420 = 0.00238 s = 0.0024 s = 2.4 ms

a) Two points that differ in phase by π/8 rad

In terms of the wavelength of the wave, this is equivalent to [(π/8)/2π] fraction of a wavelength,

[(π/8)/2π] = 1/16 of a wavelength = (1/16) × 0.738 = 0.0461 m

b) two displacements at times 1.6 ms apart.

In terms of periodic time, 1.6ms is (1.6/2.4) fraction of the periodic time.

1.6/2.4 = 2/3.

This means those two points are 2/3 fraction of a periodic time away from each other.

1 complete wave = 2π rad

Points 2/3 fraction of a wave from each other will have a phase difference of 2/3 × 2π = 4π/3.

8 0
4 years ago
. En la facultad de Ingeniería Industrial se realizó una encuesta a 200 personas para saber que lenguaje de programación preferí
GarryVolchara [31]

Answer:

lalalalapumpe

Explanation:

4 0
3 years ago
What are the main causes of injuries when using forklifts?
vagabundo [1.1K]

The forklift overturning is a very common way of getting injured from a forklift. Overturning the forklift means it tips over onto it's side due to the operator turning it too fast.

5 0
4 years ago
Other questions:
  • Consider the following program:
    15·1 answer
  • JAVA HADOOP MAPREDUCE
    13·1 answer
  • This is a multi-part question. Once an answer is submitted, you will be unable to return to this part As steam is slowly injecte
    15·1 answer
  • Perform a theoretical analysis of the rectangular profiled cantilevered beam. Provide a theoretical expression (in symbolic form
    14·1 answer
  • Oil (SAE 30) at 15.6 oC flows steadily between fixed, horizontal, parallel plates. The pressure drop per unit length along the c
    6·1 answer
  • The price of a single item within a group of items is
    8·1 answer
  • Hi plz delete this question i had to edit it cuz it was wrong question
    5·1 answer
  • A certain piece of property is assessed at $150,000. If the tax rate is $2.50 per $100, what is the tax on this property?
    6·1 answer
  • True or false for the 4 questions?
    8·1 answer
  • Engineers designed a motorcycle helmet from a long-lasting and safe material that protects the wearer from accidents and excessi
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!