Question

In: Computer Science

This exercise just lets you focus on data types, statements, etc. in C# to ease you...

This exercise just lets you focus on data types, statements, etc. in C# to ease you into the language. This

exercise is designed to allow you to focus on the data types that are appropriate for attributes of real-
world objects. Later, you will start to combine these attributes with behaviors (methods) and then

transition them into object-oriented classes.
Also, this exercise does not give explicit instructions on every field required. You will be required to
think through the attributes of these "objects" as you create the necessary data to support them in an
application.
Create a C# Console application. Within the Main() method in this application, create variables of the
correct data type for the following:
• Student information, such as:
o First Name
o Last Name
o Birthdate
o Address Line 1
o Address Line 2
o City
o State/Province
o Zip/Postal
o Country
o Any other pertinent information you want to add for a student record
• Professor information with pertinent fields related to what a professor in real-life would have.
• A university degree with pertinent fields such as Bachelor or Master.
o A degree can be Bachelor of Science in Information Technology and include fields such as
Degree Name, credits required, etc. Some of the fields, such as course list and prerequisites
will need to wait until you know how to create arrays or collections.

• A university program with pertinent fields. Fields might include:
o Program name (examples might be Business, Information Technology)
o Degrees offered (Bachelor, Master, Ph.D.)
o Department Head
• Information for a course that would be part of your selected degree and program, with pertinent
fields. Examples might be "Introduction to Computer Science" or "Introduction to Psychology".

Once you have the variables created, use assignment statements to assign values to them and use the
Console.WriteLine() method to output the values to the console window.
Challenge
Investigate the .NET Framework documenation around Console.ReadLine() and modify your code to use
this method for accepting input from a user of your application and assign it to the variables you have
created.

Solutions

Expert Solution

Note : VARIABLES have taken as per given constarints but theri data type can be changed by as per your convinience.

Also, i have provided the code for taking inputs for some varibales as well, you can learn from there and your chllenge gets completed.

Aslo, try to play with the code in any IDE, so that you cna interact wit the code.

using System.IO;
using System;

class Student
{
static void Main()
{
string firstName = "Micahel";
string lastName="Douglas";
string birthDate="4/12/1909";
string addressLine1="street 456, lane 4, near buckingam palace";
string addressLine2="NA";
string city="London";
string state_OR_Province="London";
string zip_OR_Postal="45672";
string country="UK";
Console.WriteLine("Student Details are as follows ");
Console.WriteLine(" LasstName " +lastName);
Console.WriteLine(" birthDate " +birthDate);
Console.WriteLine(" addressLine1 " +addressLine1);
Console.WriteLine(" addressLine2 " +addressLine2);
Console.WriteLine(" city" +city);
Console.WriteLine(" state/Province " +state_OR_Province);
Console.WriteLine(" zip/Postal " +zip_OR_Postal);
Console.WriteLine(" country " +country);


string professorName = "Mr.Nicolas";
string professorCourse ="Physics";
  
Console.WriteLine("Professor Details are as follows ");
  
Console.WriteLine(" professorName " +professorName);
Console.WriteLine(" Professor COurse " +professorCourse);

string universityName ="Cambridge";
float credits =100;
string programName ="Computer Science and Technology";
string degrees_offered ="Bachelor/Master/Phd";
string department_head ="Dr. Reddy";

Console.WriteLine("University Details are as follows ");

Console.WriteLine(" university Name " +universityName);
Console.WriteLine(" credits required " +credits);
Console.WriteLine(" program Name " +programName);
Console.WriteLine("Degrees Offered " +degrees_offered);
Console.WriteLine(" department head " +department_head);
  

string courseTaken ="Introduction to Computer Science";
  
Console.WriteLine(" course Taken " +courseTaken);
  
Console.WriteLine("Please enter Student details");

  
Console.WriteLine(" LasstName ");
lastName = Console.ReadLine();
Console.WriteLine(" birthDate " );
birthDate = Console.ReadLine();
Console.WriteLine(" addressLine1 " );
addressLine1 = Console.ReadLine();
Console.WriteLine(" addressLine2 " );
addressLine2 = Console.ReadLine();
Console.WriteLine(" city" );
city = Console.ReadLine();
Console.WriteLine(" state/Province " );
state_OR_Province = Console.ReadLine();
Console.WriteLine(" zip/Postal " );
country = Console.ReadLine();
Console.WriteLine(" country " );
country = Console.ReadLine();

Console.WriteLine(" Student details entered by you are");   
  


  
  
  
}
}

HOPE I have helped you.

HAPPY Learning.


Related Solutions

MY NOTES Three types of charged particles, lets call them A, B, and C, are accelerated...
MY NOTES Three types of charged particles, lets call them A, B, and C, are accelerated and then pass through a velocity selector so that we know they have the same velocity, moving to the right. They then enter a region where the magnetic field is pointing into the paper. Particles A and B are deflected upwards, as shown, while particle C is deflected downwards. The paths of the charges in the field are arcs of circles with the radii...
In python, why is it advantageous to store not just data (as vectors, arrays,etc.) but perhaps...
In python, why is it advantageous to store not just data (as vectors, arrays,etc.) but perhaps the object (an instance of your user-defined class) that contains and is able to manipulate these data in a data file through maybe the pickle module? Without importing your own class definition, will the data load from such a data file be usable or interpretable? Explain and write some codes to support your ideas if possible.
C++ employees entering data for a report (or entering into a db, etc.) this section of...
C++ employees entering data for a report (or entering into a db, etc.) this section of code will also calculate their average salary of all the entered salary amounts. This example will use a for loop for a user given number of employees, and a nested do..while loop to enter salary information. Then find the average salary for all the entered values.
c) What would you expect your urinalysis to be like after strenuous exercise (e.g, you just...
c) What would you expect your urinalysis to be like after strenuous exercise (e.g, you just completed a 10-mile run)? Specify what values you expect to have changed and why?
Identify at least three different qualitative data collection instruments (e.g. in-depth interviews, focus groups, etc.) and...
Identify at least three different qualitative data collection instruments (e.g. in-depth interviews, focus groups, etc.) and how they can be used in a study.
Lets make a Deal c# simulation? The steps that you will need to complete this homework...
Lets make a Deal c# simulation? The steps that you will need to complete this homework is: //display and output to the screen telling the player that they can win a car with exactly $1000 //simulate the rolling of the die for $100, $200 or $300 //show the player the amount they have just rolled //show the player their total amount //check if total amount has not exceeded $1000. If exceeded, game over (tell player they lost) //if total is...
C++ Please For this assignment, you will write a program that lets the user play against...
C++ Please For this assignment, you will write a program that lets the user play against the computer in a variation of the popular blackjack car game. In this variation of the game, two-six sided dice are used instead of cards. The dice are rolled, and the player tries to beat the computer's hidden total without going over 21. Here are some suggestions for the game's design: Each round of the game is performed as an iteration of a loop...
For this exercise, you will log your carbohydrate intake (proteins,fats,..etc) for 2 days, as if you...
For this exercise, you will log your carbohydrate intake (proteins,fats,..etc) for 2 days, as if you were a diabetic who weighs 140 Ibs.Then, for each meal or snack, you will calculate an appropriate dose of insulin. (use one unit per carb exchange) Insulin can either be long-acting or short acting, you will need to decide. That is, you will need to give both daily doses for “overnight and basal coverage”, as well as bolus doses for meal coverage.
Explain different types of data used in C#.•Illustrate and give examples of all predefined data types...
Explain different types of data used in C#.•Illustrate and give examples of all predefined data types in C#. C sharp
In this exercise, you will complete the Restaurant Tip application from Chapter 2’s Focus on the...
In this exercise, you will complete the Restaurant Tip application from Chapter 2’s Focus on the Concepts lesson. The application’s Planning Chart is shown in Figure 3-34. Use either a flowchart or pseudocode to plan the btnCalc_Click procedure, which should calculate and display a server’s tip. Open the Tip Solution.sln file contained in the VB2017\Chap03\Tip Solution folder. Enter the three Option statements in the Code Editor window. Use the comments as a guide when coding the btnCalc_Click procedure. Be sure...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT