Develop a functional web-based application for a calculator

Assignment Help Programming Languages
Reference no: EM13188841

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: EM13188841

Questions Cloud

Find the frequency function of x : Let T be an exponential random variable with parameter λ.let X be a discrete random variable defined as X=k if k
Find the rate of change of the distance : A particle is moving along the curve y= 2 sqrt{4 x + 4}. As the particle passes through the point (3, 8), its x-coordinate increases at a rate of 2 units per second. Find the rate of change of the distance from the particle to the origin at this i..
How many boxes would be on the bottom row : ose the clerk had to stack 200 boxes of cereal in a triangle. how many boxes would be on the bottom row?
What is the maximum per unit that sellers are willing to pay : Now assume that intermediaries come from a competitive market with and equilibrium price of $8 per unit for their services, that is, any buyer or seller who wants an intermediary's services must pay $8 for them. What is the maximum per unit that s..
Develop a functional web-based application for a calculator : 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.
Determine which were important and which were not : Like supermarkets, full-service department stores like Macy's are generally in decline. What factors might these types of stores have in common behind their declines How would you determine which were important and which were not
Determine the divergence of the volume integral : Determine the divergence of the volume integral of Q/r^2 r(vector)over the sphere of radius 5 by solving the surface integral.
How the tax affects the market for roquefort cheese in us : At the beginning of the 2000s, the United States imposed high taxes on a number of European goods due to a trade dispute. One of these goods was Roquefort Cheese. Show how this tax affects the market for Roquefort cheese in the United States, shif..
What will be the value of cassandra dresser : Cassandra bout an antique dresser for $500. If the value of her dresser increase 6% annually, what will be the value of Cassandra dresser at the end of 3 years?

Reviews

Write a Review

Programming Languages Questions & Answers

  Write the program which reads two strings

Write the program which reads 2 strings, age (as a 4 bit binary number) followed by first name from keyboard then converts age from binary to decimal and prints out age in decimal.

  Write a driver program to test class

Create a class called Rational for performing arithmetic with fractions. Write a driver program to test your class. Use integer variables to represent the private instance variables of the class-the numerator and the denominator.

  Program to input the assignment number

The program must prompt teacher to input the assignment number. Score for student for that assignment will be displayed.

  Write program to read file consisting of students test score

Write program which reads a file consisting of students test scores in range 0-100. It muts then determine number of students having scores in each of the ranges.

  Top-down modular approach and pseudocode to create program

Use top-down modular approach and pseudocode to create a appropriate program to solve it. Where suitable, use defensive programming techniques. Give both pseudocode and flow chart algorithms.

  Give greedy algorithm to get all n people across bridge

Give a greedy algorithm to get all these n people across the bridge in a fastest way. Describe the algorithm briefly. Prove the correctness.

  Defining method dashedline with one parameter

Write a definition of method dashedLine, with one parameter, an int .

  Explain about lexical analyzer

Explain about Lexical Analyzer

  Program to take input five numbers-display mean average

Write the program which takes as input five numbers and outputs mean average and standard deviation of numbers. If numbers are x1, x2 ,x3, x4, and x5, then mean is?

  Does loop have dependences two-dimensional arrays

Consider the following code with two-dimensional arrays. Does this loop have dependences? Can these loops be written so they are parallel?

  Program to keep track of the seat availability of flight

A small airline company needs a program to keep track of the seat availability of its flights. Design the structure type FLIGHT to store a four-digit flight number.

  Design a program written psuedocode enter total rainfall

Design a program WRITTEN IN PSUEDO CODE that lets the user enter the total rainfall for each of 12 months into an array.

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