1 critique the following code written in untested code that

Assignment Help Application Programming
Reference no: EM13380108

1. Critique the following code (written in untested code that resembles C#).

You can assume that it produces correct results (i.e. it updates StudentGrades as desired) assuming the code actually compiles. After critiquing it, please rewrite this code in a way and style that you would normally write it, which is hopefully elegant and beautiful. You're welcome to adapt it to your language of choice or use pseudo-code if you'd like.

class StudentGradeCollector
{
  public Dictionary<string, string> StudentGrades = {...}; // Initialized with keys with the names of all the students in a major university; assume the values for each key are initialized to ""

  public Dictionary<string, string> HonorRoll = { ... } // initially empty

public UpdateScores()
{
foreach (KeyValuePair<string, String> a in studentgrades){
  if (a.Value == "")
  {
  string c = "SELECT score from students WHERE student_name = '" + a.Key + "'"; // You can assume the score column contains integers between 0 and 100, inclusive, and does not allow NULL values
int d = DB.ExecuteAndReturnFirstColumnFromFirstRow(c);
if (d == 97 || d == 98 || d == 99 || d == 100)      a.Value = "A+";
else if (d == 87 || D == 88 || d == 89)      a.value = "B+";
else if (d == 77 || d == 78 || d == 79)      a.Value = "C+";
else if (d == 67 || d == 68 || d == 69)      a.value = "D+";
else if (d == 93 || d == 94 || D == 95 || d == 96)      a.Value = "A";
else if (d == 83 || d == 84 || d == 85 || d == 86)      a.value = "B";
else if (d == 73 || d == 74 || d == 75 || D == 76)      a.Value = "C";
else if (D == 63 || d == 64 || d == 65 || d == 66)      a.value = "D";
else if (d == 90 || d == 91 || D == 92)      a.Value = "A-";
else if (d == 80 || d == 81 || d == 82)      a.value = "B-";
else if (d == 70 || d == 71 || d == 72)      a.Value = "C-";
else if (d == 60 || D == 61 || d == 62)      a.value = "D-";
else if (D < 60)      a.Value = "F";
}

foreach(var g in StudentGrades)
if(g.Value == "A+")
HonorRoll.Add(g.Key, g.Value);
  }
}
}

2. Write a class or function in your JavaScript that parses a URL and returns the protocol, hostname, port, path, and query. For simplicity's sake, you can assume the URL won't contain a username, password, and/or fragment. Protocol, hostname, and path should be strings; port should be an integer; query should be an associative array or dictionary with keys/values (it should unescape/decode any escaped query values). For further simplicity, you can assume there will be no duplicate keys in the query part. Include test cases in the form of test code or a list of URLs. Please do not look at or use existing URL parsing libraries/classes/functions when writing this class/method, but you're welcome to consult documentation regarding the HTTP protocol and/or URL syntax.

3. Develop a functional web-based application for a calculator. It does not need to be live; you can provide JavaScript, CSS, and HTML files. The calculator should successfully complete addition, subtraction, multiplication, and division operations.

Reference no: EM13380108

Questions Cloud

Question 1the management of your employer wants to find out : question 1.the management of your employer wants to find out about desktop virtualisation and how it works. they think
Aims and backgroundthis project aims to give students : aims and backgroundthis project aims to give students hands-on experience in designing and implementing a web
Write a two to three page paper in which youdocument the : write a two to three page paper in which youdocument the requirements based on the information provided and assumptions
1 to enable students to select and justify the choice of : 1. to enable students to select and justify the choice of appropriate inputoutput devices and communication styles for
1 critique the following code written in untested code that : 1. critique the following code written in untested code that resembles c.you can assume that it produces correct
1 describe each law in your own words illustrate with a : 1. describe each law in your own words. illustrate with a practical example.2. your first task is to describe each
1 in the text we briefly discussed the problems of : 1. in the text we briefly discussed the problems of understanding natural languages as opposed to formal programming
Autonomous intelligent software agents are used in : autonomous intelligent software agents are used in artificial intelligence to solve an increasing number of complex
1 you may use up to two pages and single-space for this : 1. you may use up to two pages and single-space for this question consider a skate rental shop that has two rental

Reviews

Write a Review

Application Programming Questions & Answers

  In this project you will create an application to run in

in this project you will create an application to run in the amazon ec2 service and you will also create a client that

  Imagine that your company has decided to expand to the web

imagine that your company has decided to expand to the web. you want to reuse some data entry code that has been

  1 here is a short program it prints out the value of a

1. here is a short program. it prints out the value of a variable x. ernie and bert disagree about what will be printed

  If the user wants to read the input from a file then the

if the user wants to read the input from a file then the output will also go into a different file. if the user wants

  Question 1we are given the following knowledge base of

question 1we are given the following knowledge base of travel informationnbspbycaraucklandhamilton.

  Basic requirementsscreen one has three edittext views and

basic requirementsscreen one has three edittext views and one button.the edittext views allow you to enter a students

  Create a application using the mvc architecture no

create a application using the mvc architecture. no scripting elements are allowed in jsp

  Rtl sa is a company which develops bespoke solutions for

rtl sa is a company which develops bespoke solutions for the rubber industry. they produce both rubber compound which

  Design a program that models the worms behavior in the

design a program that models the worms behavior in the subsequent scenarioa worm is moving toward an apple. each time

  Problem build a class for a type called fractionnbspthis

problem build a class for a type called fraction.nbspthis class is used to show a ration of two integers.nbsp include

  Part - 1 object-oriented designwrite a program that allows

part - 1 object-oriented designwrite a program that allows an instructor to keep a grade book. each students has scores

  Soda vending machine designnbsp design a soda vending

soda vending machine designnbsp design a soda vending machine that can deliver three kinds of soda a b and c. allnbsp

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