C# Programming Platform II Sorting Basics Assignment For this assignment you need to do the following: Step 1: Create a console application named yourname_sortingbasics. Make sure that you use a...

1 answer below »
DUMMY


C# Programming Platform II Sorting Basics Assignment For this assignment you need to do the following: Step 1: Create a console application named yourname_sortingbasics. Make sure that you use a windows classic desktop console application/.Net Framework console application and not a .Net Core console application. Step 2: Create a Student class that has the following: a. StudentID, LastName, FirstName, CourseID and Course Grade properties. b. A constructor that collects the above property information. c. A method that retrieves test data for this Student class. This method will use the following code for testing purposes: public static List getTestStudents() { // For testing purposes some duplicate student infomation will be used. List students = new List students = Student.getTestStudents(); Console.WriteLine(Student.SortTitle("Not Sorted")); Console.WriteLine(Student.ColumnHeader()); foreach (Student student in students) { Console.WriteLine(student); } Console.WriteLine("\nPress to quit..."); Console.ReadKey(); You should see a data dump on the test student data similar to the following: Note: Google string format operations to see what options you have in terms of using right hand justification, left hand justification, PadLeft, PadRight, etc. Step 4: Modify your Student class to add a default last name, first name sort capability. The IComparable interface is used typically to compare the current class instance with other instances of the same type. To use this technique, you would add to the Student class the IComparable interface: public class Student : IComparable The compiler will then warn you that you need to implement the interface member CompareTo. Now implement the CompareTo method to allow sorting by last name and then first name. Note: when doing name comparisons you usually uppercase all of the string characters first before processing the sort options. Thus make sure you UpperCase first and last name so that no sort differences with occur based on case differences. Bill Gates versus bill Gates or bill gates. 10 points are scored if you correctly implement the CompareTo method to provide this last name, first name sort capability. To test your CompareTo method in your main method add the following code: // Sort using built in Student IComparer default sort... Console.WriteLine(Student.SortTitle("Sorted by Last Name and First Name Using Built in IComparable")); Console.WriteLine(Student.ColumnHeader()); students.Sort(); foreach (Student s in students) { Console.WriteLine(s); } Your console screen should then show the following: Note: Original data is preserved. However, you can output upper cased string data if you wish. Step 5: Now let’s examine the common situation of multiple sorts done on multiple sort fields. The IComparer interface is used when you want to compare 2 objects of the same type. It can be implemented with nested classes or separate external classes. As an example let’s set up a separate class called StuSortCourseGradeLastFirst that provides sorting capability on course grade, then last name and first name: Points scored for implementing correctly a sort by course grade, last name and then first name: 10 points To test this sort add the following code to your Main method: Console.WriteLine(Student.SortTitle("Sorted by Course Grade, Last Name, and then First Name Using IComparer")); Console.WriteLine(Student.ColumnHeader()); students.Sort(new StuSortCourseGradeLastFirst()); foreach (Student s in students) { Console.WriteLine(s); } Step 6: Now let’s sort your students by Last Name, First Name and then CourseID with another sort class such as StuSortLastFirstCourseID. Points: 10 Step 7: Finally let’s sort your students by Last Name, First Name and then CourseID and then CourseGrade you would just add another sort class such as StuSortLastFirstCourseIDCourseGrade. Points: 10 Step 8: Save your work and run your application! When you finish your project put your zipped project in the UCLA Module 2 application submission area. Remember that I need to run your project from my machine so make sure your zipped project folder contains all of your work. Also note that we are not using LINQ, SQL or Lambda expressions yet for a sorting technique. When we examine functional programming, you are going to find that sorting becomes an extremely simple operation. Total points for this project: 50 (10 points for each sort condition for a total of 4 sorts) with the remainder of the points being distributed based upon project functionality, report formatting, coding style, etc. floor-1-4hrwsah0.dwg floor-2-ajaryimm.dwg flr-b-nj01k4s4.dwg Do the exercises 5.docx Do the exercises 5-1 to 5-4 for the elevation study in the textbook. You will be drawing 4 elevations of the floor plans that were drawn in the previous assignment. · You will need to upload the file in PDF format. View the video to learn how to set up the PDF printing procedure from Paper Space. TextbooksStine, D.J. (2021). Residential Design Using AutoCAD 2021 Mission, Kansas: SDC Publications Jefferis, Allan; Madsen, D.A. & Madsen, D.P. (2010) Architectural Drafting and Design, 6th ed. Boston, MA; Cengage Learning. You will need access to AutoCad 2021 The assignment will need to be turned in as a PDF
Answered 41 days AfterJul 10, 2021

Answer To: C# Programming Platform II Sorting Basics Assignment For this assignment you need to do the...

Manjunath answered on Aug 20 2021
147 Votes
yourname_sortingbasics/yourname_sortingbasics.sln
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "yourname_sortingbasics", "yourname_sortingbasics\yourname_sortingbasics.csproj", "{98E8D1CF-05EA-478B-BD99-263094A358A5}"
EndProject
Global
    GlobalSection(SolutionConfigurationPlatforms) = preSolution
        Deb
ug|Any CPU = Debug|Any CPU
        Release|Any CPU = Release|Any CPU
    EndGlobalSection
    GlobalSection(ProjectConfigurationPlatforms) = postSolution
        {98E8D1CF-05EA-478B-BD99-263094A358A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
        {98E8D1CF-05EA-478B-BD99-263094A358A5}.Debug|Any CPU.Build.0 = Debug|Any CPU
        {98E8D1CF-05EA-478B-BD99-263094A358A5}.Release|Any CPU.ActiveCfg = Release|Any CPU
        {98E8D1CF-05EA-478B-BD99-263094A358A5}.Release|Any CPU.Build.0 = Release|Any CPU
    EndGlobalSection
    GlobalSection(SolutionProperties) = preSolution
        HideSolutionNode = FALSE
    EndGlobalSection
EndGlobal
yourname_sortingbasics/yourname_sortingbasics.v11.suo
yourname_sortingbasics/yourname_sortingbasics/App.config




yourname_sortingbasics/yourname_sortingbasics/bin/Debug/yourname_sortingbasics.exe
yourname_sortingbasics/yourname_sortingbasics/bin/Debug/yourname_sortingbasics.exe.config




yourname_sortingbasics/yourname_sortingbasics/bin/Debug/yourname_sortingbasics.pdb
yourname_sortingbasics/yourname_sortingbasics/bin/Debug/yourname_sortingbasics.vshost.exe
yourname_sortingbasics/yourname_sortingbasics/bin/Debug/yourname_sortingbasics.vshost.exe.config




yourname_sortingbasics/yourname_sortingbasics/bin/Debug/yourname_sortingbasics.vshost.exe.manifest









yourname_sortingbasics/yourname_sortingbasics/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
yourname_sortingbasics/yourname_sortingbasics/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
yourname_sortingbasics/yourname_sortingbasics/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
yourname_sortingbasics/yourname_sortingbasics/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
yourname_sortingbasics/yourname_sortingbasics/obj/Debug/yourname_sortingbasics.csproj.FileListAbsolute.txt
D:\greynodes-project\yourname_sortingbasics\yourname_sortingbasics\bin\Debug\yourname_sortingbasics.exe.config
D:\greynodes-project\yourname_sortingbasics\yourname_sortingbasics\bin\Debug\yourname_sortingbasics.exe
D:\greynodes-project\yourname_sortingbasics\yourname_sortingbasics\bin\Debug\yourname_sortingbasics.pdb
D:\greynodes-project\yourname_sortingbasics\yourname_sortingbasics\obj\Debug\yourname_sortingbasics.csprojResolveAssemblyReference.cache
D:\greynodes-project\yourname_sortingbasics\yourname_sortingbasics\obj\Debug\yourname_sortingbasics.exe
D:\greynodes-project\yourname_sortingbasics\yourname_sortingbasics\obj\Debug\yourname_sortingbasics.pdb
yourname_sortingbasics/yourname_sortingbasics/obj/Debug/yourname_sortingbasics.csprojResolveAssemblyReference.cache
yourname_sortingbasics/yourname_sortingbasics/obj/Debug/yourname_sortingbasics.exe
yourname_sortingbasics/yourname_sortingbasics/obj/Debug/yourname_sortingbasics.pdb
yourname_sortingbasics/yourname_sortingbasics/Program.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace yourname_sortingbasics
{
public class Student : IComparable
{
public int StudentID;
public string LastName, FirstName, CourseID;
public double CourseGrade;
// Constructor Declaration of Class
public Student(int StudentID, String LastName, String FirstName, String CourseID,
double CourseGrade)
{
this.StudentID = StudentID;
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here