Create the classes phonebook school and student

Assignment Help DOT NET Programming
Reference no: EM131390668

Project

School/Student Phonebook

Your task is to create the classes School, Student and Phonebook, such that the following Main( ) function should compile and execute correctly:

Implementation hints:

• Create the classes Phonebook, School and Student. You will need to write a constructor for School that accepts a single string which is the name of the school.

• Create properties for the class School. The class School needs only one property which stores the name of the school (of type string). It also needs a class member variable which stores a collection of students. The best way to do that is to use a class similar to C++'s std::vector, called List<>. It can be found in the namespace System.Collections.Generic, so you will need to add a using statement at the top of the School.cs file. Then, you should initialize this variable in the class constructor:

Students = new List<Student>( );

• Similarly you have to add one class member variable (property of the List<School>)to the class PhoneBook which stores a collection of schools. You could use the same method as for studens for this property.

• Add a function to the class School called AddStudent. It should accept a single parameter of type Student. It should simply store the student instance in the List<Student> member variable (use the Add( ) function which works similarly to the push_back( ) function in std::vector).

• Add properties to the class Student. You will need two properties: SSN, Name and Age. I'll leave it to you to figure out the type of these properties.

• Override the ToString functions in both classes (see the book for details). The Student version of ToString is quite simple, while the School implementation will need the following:

o A local string variable that will contain the end result. You can then use the += operator to concatenate to this variable, and use System.Environment.NewLine; to add a newline to the string. Example:

string result = "Some string" + System.Environment.NewLine; result += "some other string";

o A loop that walks through all students in the collection (also, see the book about foreach statements), and adds each student to the string. Note: you can either call the ToString method for each student explicitly, or use a syntax similar to the one seen inside Main above, where the School instance is printed out explicitly.

• You will new to added the following functions to the PhoneBook class in order to comply with the main program given:

o AddNewSchool:

- Ask user for name. Create new school and add to PhoneBook schools.

o AddNewStudentToSchool:

- For this part you will have to figure out how to ask the user for which school to add the student to. One solution could be to ask the user for the index of the school and then ask user for ssn, name and age, and add the student to chosen school.

o EditStudentInSchool:

- Very similar for when adding new students to schools, you will have to figure out how to ask the user for which school to look for the student in as well as how to ask the user for which student to edit. Both could be solved by asking the user for index of school and then index of student in the corresponding list. Then just ask user for update ssn, name and age, and update the chosen student.

o Override the ToString:

- Simililar to the School class, you could have a loop that walks through all school in the phonebook and call the ToString method for each school explicitly. The printout example above should give you a good idea this should look like

o Html:

- This function should be very similar to sample printout, e.i. it should return a string containing the printout for the entire phonebook. The only difference being that output should be valid HTML.

- This could be an example for the HTML function:

public string Html()
{
StringBuilder result = new StringBuilder();
//...
result.Append(" append html some content ");
//...
//Create and save file a project root
using (StreamWriter writer = new StreamWriter("result.html"))
{
writer.WriteLine(result);
}
//return HTML
return result.ToString();
}

- You will also need to implement the following requirements:

• Make sure to have a single table in the body of the document
• <html>, <head>, <title>, and <body> are mandatory
• all tags must be properly nested
• all tags are in lowercase (<h1> instead of <H1>)
• all tags are properly closed, and empty elements have a trailing slash
• (<strong></strong>, and <img src="..." />)
• all attribute values are properly quoted (<img alt="Hello" /> instead of <img alt=Hello />)
• all attribute names must be in lower case

Hand in

The deadline for this assignment can be seen on myschool. Hand in a single .zip/.rar/.7z file containing the .cs files plus the .exe file:

• School.cs
• Student.cs
• PhoneBook.cs
• Program.cs
• PhoneBookApp.exe

Please note that this is an individual assignment.

Attachment:- Project.pdf

Reference no: EM131390668

Questions Cloud

Produce proteins for exportation : What are some examples of human cells that produce proteins for exportation?
Which controls cellular function : Which molecule contains the genetic information that is transmitted hereditarily and which controls cellular function?
Discuss about the kohlbrergs model of moral development : compare and contract Kohlbrerg's model of moral development to Carol Gilligan's care ethic.How do they complement each other according to Applied Professional Ethic?what different bwt the idea of intention and the motive according to Applied profes..
Explain whether discount is correct in given contention : Discount refuses, and A, B, and C refuse to sell to Discount. Discount contends that A, B, and C are in violation of antitrust law. Explain whether Discount is correct.
Create the classes phonebook school and student : Create the classes Phonebook, School and Student. You will need to write a constructor for School that accepts a single string which is the name of the school.
Define the security strategies of defense in depth : In this paper, you will define the security strategies of Defense in Depth and Layered Security along with comparing and contrasting the strategies by explaining
Would your answer differ if z reduced its price : Z sells cameras to A, B, C, and D for $160 per camera. Y, one of Z's competitors, sells a comparable camera to A for $148.50.- Would your answer differ if Z reduced its price to A to $140?
Advise giant as to the validity of its alternatives : Giant is presently seeking to obtain an exclusive dealing arrangement with Universal or to acquire Universal. Advise Giant as to the validity of its alternatives.
Discuss the validity of the given : Discuss the validity of the given:- An agreement between manufacturer and distributor not to sell a dealer a particular product or parts necessary for the product's repair.

Reviews

Write a Review

DOT NET Programming Questions & Answers

  Webiste hi sir u need bild the website i will explain you

hi sir u need bild the website i will explain you the the procedurethere is a rar file which i cant uplode hear this

  Create a program named taxcalculation

Create a program named TaxCalculation that includes tow overloaded methods-one that accepts a price and a tax rate expressed as doubles (for example, 79.95 and 0.06, where 0.06 represents 6%),

  Write down a visual studio c console application to

write a visual studio c console application to simulate the rolling of two dice. use an object of the random class for

  Write a c sharp dot net code for file system watcher

Write a C sharp dot Net code for File System Watcher.

  Write asp dot net script to enter two integers

Write down the ASP.NET script to enter two integers, gets numbers from user and outputs to label which displays larger number followed by words "is larger".

  Prepare a web application that will be used to keep track

prepare a web application that will be used to keep track of patients registering in a hospital.this application will

  Convert meters to feet and inches.

1. Write a program that can be used to convert meters to feet and inches. Allow the user to enter a metric meter value in a method .

  1- true or false tomcat allows you to deploy multiple java

1- true or false tomcat allows you to deploy multiple java web applications in your web apps folder in your home

  Program to find average of test scores input by user

Write down a C# program to find average of test scores input by user. Use pseudocode in which user inputs number of test scores and each test score.

  Describe two types of loops that can be used to print

Describe two types of loops that can be used to print every third integer from 0 to 300 (i.e., 0, 3, 6, 9, etc.), each on its own line. Which would be a better choice and why? Write the code using that type of loop.

  Create static methods with and without return values

Create static methods with and without return values. Calling static methods with and without arguments. Casting data types. Proper internal documentation.

  Programming uml

programming uml

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd