Create program that converts Centigrade to Fahrenheit

Assignment Help JAVA Programming
Reference no: EM132238036

Scripting for Design Assignment - Functions

OVERVIEW: Your task in this assignment is to create a JavaScript program that converts three Centigrade temperatures to three Fahrenheit temperatures.

The JavaScript code will work with four HTML elements:

  • 2 input elements for the input i.e. Centigrade temperature values.
  • 1 div element for the output i.e. Fahrenheit temperature values.
  • 1 button element to start the process.

Completion of the assignment will require coding two functions:

1. an onclick function that is connected to the button (as before).

2. a programmer defined function named convertToFahrenheit which will return a Fahrenheit temperature given the Centigrade value.

The code required for convertToFahrenheit is essentially the same as the convertToCentigrade function example provided in the TOPIC 4 notes, with the temperature scales reversed. The main change is the expression used to do the conversion. In the convertToFahrenheit function the expression to convert a Centigrade temperature to Fahrenheit is: 1.8 * degCentigrade + 32, where degCentigrade is the only parameter used by the function.

The input will consist of two Centigrade values, a base temperature and an increment. These two will determine the three Centigrade temperatures to convert. For example if a base temperature of 10 and an increment of 5 are entered then the code would convert 10oC, 15oC, and 20oC to their Fahrenheit equivalents i.e. it starts at 10 and bumps it up by 5, twice.

Therefore if the variables baseTemp and incrTemp are used to store the input values, the program would have to convert the three temperatures:

baseTemp

baseTemp + incrTemp

baseTemp + 2 * incrTemp

In summary, when the button is clicked the code that makes up the onclick function will:

1. input values from the text fields into variables

2. parse the input values

3. call the convertToFahrenheit function three times to convert the three Centigrade temperatures to Fahrenheit

4. round the Fahrenheit values to whole numbers

5. format and output the results to the div.

NOTE: Your objective is to code the JavaScript statements to produce the required structure, content, and especially the behavior.

Attachment:- Assignment File.rar

Reference no: EM132238036

Questions Cloud

Why would an organization divide a project into phases : When considering the selection of projects to be initiated, project portfolio management considers all of the following except for which one?
What are the ramifications of government contribution : What are the ramifications of government contribution and control of the Internet that nobody possesses?
Which supplier to choose to provide wiring and casing : What are some things that they might look at to determine which supplier(s) to choose to provide the wiring and the casing?
Develop mind-map for mcdonald to solve problem : cDonald’s across the globe and in the UK highlighted a consistent decline in sales. Develop a mind-map for McDonald to solve the problem.
Create program that converts Centigrade to Fahrenheit : CWMD2601 - Scripting for Design Assignment - Functions, DURHAM COLLEGE, Canada. create a JavaScript program that converts Centigrade to Fahrenheit temperatures
Describe the performance management cycle in public sector : Describe the performance management cycle in public sector?
Taking more proactive approach to retention outreach : These myths prevent organizations from taking a more proactive approach to retention outreach or becoming involved with retention outreach teams.
Weaknesses of business before taking strategic decisions : Why do you think it is important to analyse the existing strengths and weaknesses of a business before taking strategic decisions?
Why operations management is vital to his-her organization : Provide insights into your subject's role and why Operations Management is vital to his/her organization.

Reviews

len2238036

2/20/2019 1:12:34 AM

In this assignment is to create a JavaScript program that converts three Centigrade temperatures to three Fahrenheit temperatures. ASSIGNED - At date and time shown in DC Connect. DUE - At date and time shown in DC Connect. There is a 25% penalty for late assignments. Refer to the course outline for details. DEADLINE - Seven (7) days after due date and time shown in DC Connect unless noted otherwise. No assignments accepted after the deadline.

len2238036

2/20/2019 1:12:28 AM

MARKING - Marked out of 100 (80 for function, 10 for style, and 10 for documentation). Full marks given only if your solution: meets all of the requirements, has no runtime errors , follows all of the course coding conventions, uses only the JavaScript and DOM capabilities covered to this point in the course i.e. no JS libraries, uses external JavaScript and is submitted as a single zipped folder with all required files. SUBMITTING - Upload your work using the correct drop box in DC Connect. Only work submitted through DC Connect will be marked. Upload all required files (i.e. .html, .css, .js) as one compressed archive i.e. a zipped folder.

len2238036

2/20/2019 1:12:22 AM

The marking breakdown for this assignment is as follows: JavaScript code is connected to the button using the onclick property and the getElementById method, all required variables declared, input text fields are cleared and their values parsed, custom function convertToFahrenheit coded as required with one parameter and a return giving the correct converted value, custom function convertToFahrenheit called three times with the correct arguments and the returns value used, return values are rounded i.e. not rounded in the function, the output displayed includes all required values is properly formatted using p, ul, and li (including the symbol).

len2238036

2/20/2019 1:12:15 AM

REMEMBER, TO AVOID LOSING MARKS UNNECESSARILY - Only use JavaScript and DOM capabilities that have been covered to this point in the course to complete the assignment. Do not use any JavaScript libraries or frameworks such as jQuery. Always test your program with a variety of input values to ensure that it is working correctly i.e. has no syntax errors and produces the expected results. Add opening comments to identify yourself as the programmer and explain the purpose of your program. Add comments to document your code. View your source in Firefox before submitting to make sure that the indentation and white space are correct, and that horizontal scrolling is not required. Load all JavaScript code from one external file and submit all of the files used in the solution as one zipped folder. As the very last thing you do before submitting, test your program one more time and check the Console to ensure it is error free.

len2238036

2/20/2019 1:12:05 AM

NOTE: In general, the CSS or presentation of your solution (colors, fonts, margins, etc.) is at your discretion and does not usually contribute to your mark in the assignment. Your objective is to code the JavaScript statements to produce the required structure, content, and especially the behavior.

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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