Develop a functional web-based application for a calculator

Assignment Help Software Engineering
Reference no: EM13314053

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

Questions Cloud

Problem on network security planning : Securing a large internetwork remains a daunting challenge. Cloud computing and social networks add to this complexity. In two to three (2-3) pages, and using the CISCO SAFE reference architecture.
Determine what would the weir coefficient be : if the discharge from a 90 degree V-notch weir fills a 20 L vessel in 54 seconds and produces a stage of 30mm upstream of the weir crest, what would the weir coefficient be
Find the speed of the bucket : A bucket of mass 2.00 kg is whirled in a vertical circle of radius 1.10 m. At the lowest point of its motion the tension in the rope supporting the bucket is 25.0 N. Find the speed of the bucket
Explain what is the formula for the compound with a valency : What is the formula for the compound formed between germanium with a valency of (IV) and antimony with a valency of (III)
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..
The real world application of the chosen technology : The real world application of the chosen technology
Calculate the change in internal energy of the system : A cylinder which is in a horizontal position contains an unknown noble gas at 4.63 × 104 Pa and is sealed with a massless piston. calculate the change in internal energy of the system
Find the net rate of radiation by a pot : Find the net rate of radiation by a pot at 45.1°C that has been placed in a -24.1°C freezer. The pot\'s surface area is 0.117 m2 and its emissivity is 0.635
State alpha particle produces a proton and other radioactive : Bombardment of nitrogen-14 with an alpha particle produces a proton and what other radioactive isotope

Reviews

Write a Review

Software Engineering Questions & Answers

  Flowchart for physical goods are shipped back to supplier

Sketch a document flowchart to depict each situations: Physical goods are shipped back to the supplier.

  Create the flowchart for program to accept candy name

Create the flowchart or pseudocode for following:a. A program which accepts the candy name (for instance, "chocolate-covered blueberries"), price per pound, and number of pounds sold in average month

  Draw erd for student entity

Draw and ERD for this situation. What attribute or attributes did you designate as the identifier for the STUDENT entity? Why?

  Data flow diagram for student assistant of local law firm

Design a data flow diagram to include all functions and data flows as described in this situation, starting from time you submit your time sheet.

  Software development process

Imagine you are a team leader in a large software development organization and you want to improve a software development process (of your choosing) through the use of a CASE tool.

  Question about ranges and functions

Assume you have functions that you want to call for many individual year values, as well as ranges of years, and you are deciding on whether to use an if statement or a switch statement.

  Explain understanding plan-do-check-act process flow

The project where risk and quality processes make obsolete portions of project plan, how is plan maintained (updates, corrections)? What is context for understanding plan-do-check-act process flow?

  Create single conceptual erd showing entity-s primary key

Create single Conceptual ERD (on a single slide) for entire Case Study showing all attributes and identifying each entity's primary key.

  Create the entity relationship diagram for hospital

Create the Entity Relationship Diagram(ERD) for following hospital scenario. For Patient entity illustrates its attributes. Highlight key attribute in red.

  Bank customer withdrawing money from an atm

Describe (in a one to two (1-2) page narrative) a use case, complete with typical and alternate courses, that documents the event of a bank customer withdrawing money from an ATM.

  Consider the following program segment

Consider test cases  t 1 = ( n  = 3) and  t 2 = ( n  = 5). Although these tour the same prime paths in  printPrimes() , they do not necessarily find the same faults. Design a simple fault that  t 2 would be more likely to discover than  ..

  Compute student grades via linux shell script

Construct a shell script to run on Knoppix or Linux, that will compute and display the letter grades for the students based on the average of four test scores.

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