CSC1401 Foundation Programming Assignment

Assignment Help Programming Languages
Reference no: EM132471690

CSC1401 Foundation Programming Assignment - University of Southern Queensland, Australia

Goals and Topics - The assignment problem is straightforward. All necessary details have been supplied. The solution of the problem will be straight line code which will use the programming concepts and strategies covered in Workshops 1-3. The subgoals are:

i. Understanding values, variables and constants, Objects, Operations, and Functions

ii. Translating simple design into JavaScript code

iii. The mechanics of editing, interpreting, building and running your program

iv. Testing your program

v. Commenting your source code

vi. Becoming confident and comfortable with programming in small problems

Task - "Days-From-beginning" is an interesting and useful feature in website design. It shows up how many days (or even with hours, minutes, and seconds) after an event started. For example, a feature of Days-From-Birth shows the number of days after the date of birth. In this assignment, you are going to write a JavaScript program to implement the "Days-From-Birth" feature.

Functional Requirements -

Constants and Variables-

Within the script section, create constants and variables following professional conventions and initialise them using right values. Some constants and variables have been suggested in the following tables. You should create more when necessary.

Calculation-

1. Create a Date object for the date of birth by using the variables created previously.

Use one prompt function to input the name of user as Figure 2.

Use another three prompt functions to input the year, month, day of the birth one by one and then transfer them to the Date constructor.

Mind the order of arguments sent to the constructor;

Note that month numbers in Date constructor begin at 0 for January ('1' entered in prompt function), 1 for February ('2' entered in prompt function), and so on;

2. Create a Date object for the current time.

No arguments need to be supplied to the constructor.

3. Calculate the difference between the current time and the birth time (assume it is the starting time 0:00:00 a.m. on the Date of birth):

Use the getTime() member function to get a Date object's time value in milliseconds.

Deduct the time value of current time by using the value of event time.

4. Calculate the number of days from the birth:

Divide the time value difference by the number of milliseconds in a day.

Use the Math.floor() function to reduce the result number to an integer.

Presentation -

Figure 3 shows a sample output when running the "Days-From-Birth" program. Note that

- the information should be displayed using the alert() function;

- wherever possible you should use variables in expressions instead of explicit values (e.g., literals and numbers), for example, using the variable created for the user name instead of a string value of "Lily"; "XXXX" is the number of days from the date of birth.

- the layout of output may vary depending on web browsers.

Testing - Test your program by enter your own date of birth to see whether the outcome is correct or not.

Non-functional Requirements -

Structure of the Source Code-

All code should appear in the script section in the head of the HTML document

Do not write any code in the HTML body. All functionality are delivered by JavaScript.

In the script order your code as follows:

(a) Constants;

(b) Variables and objects (declared and initialised);

(c) Other statements.

Comments -

You are required to add at least three comments to the source code.

Do not comment every single line, instead, comment on blocks of code with a common purpose.

Do not simply translate the syntax into English for comments, instead, describe the purpose of blocks of code.

Note - All required figures and information are in attached files.

Attachment:- Foundation Programming Assignment Files.rar

Reference no: EM132471690

Questions Cloud

What would the excel formula look like for getting the fv : Calculate the future value in ten years of $2,000 received today if your investment is 6 percent compounded annually? What would the excel formula look like
South korean money supply : At what rate has the South Korean money supply been growing (i.e., what is DMs/Ms)? Please show your calculations.
What value is used to account for complimentary items : In a hotel owned and operated casino operation, what value ( for accounting purposes) is used to account for complimentary items provided to guests?
Limitations of conventional monetary policy tools : According to the article, what are the reasons why central banks have turned to unconventional monetary policies in the past two decades?
CSC1401 Foundation Programming Assignment : CSC1401 Foundation Programming Assignment Help and Solution - University of Southern Queensland, Australia. Implement the "Days-From-Birth" feature
Calculate the tax revenue and excess burden : Assuming an elasticity of demand of -0.85 and elasticity of supply of 2.5,
Evaluate the incremental changes to cash flows : What budgeting tools to compute future projections of cash flows? Also, it states to "remember to only evaluate the incremental changes to cash flows
Deficit relative to the initial level of the deficit : Analyze the impact on the quantity of loanable funds available in this market, and the effect it has on the interest rate for these loanable funds
Discuss strategy from porte model to make quebecor printing : Focused on customized service by using "selective binding" to print. Apply strategies from Porter's model to make Quebecor Printing's business more profitable.

Reviews

Write a Review

Programming Languages Questions & Answers

  Pseudocode for a program to solve mathematical problem

Pseudocode for a program to solve the following problem. A student borrows $3,000 at an interest rate 2% per month on the unpaid balance.

  Develop an interactive e-learning tool in english language

Write a simple description about the program H. Design and display the screenshot of each form and label the different objects - develop an interactive e-learning tool in English language learning for kids

  Model driven co-evolution of business processes

Prepare a design for the implementation of a co-evolutionary approach - Software Engineering Lab is developing state-of-the-art techniques for the abstraction

  A class method to initialize class data members.

Sales class data members for a char letter input from the console, a double to hold each individual sale as it is entered and a double for each of the individual salesperson's total commission.

  Rewrite returns expression in which cond has been replaced

Write the function rewrite (x), x is an s-expr. If x is not a "legal" cond, rewrite returns nil. Otherwise, rewrite returns an expression in which each cond has been replaced by an equivalent sequence of nested if- then.

  Write a program that instantiates four sphere objects

Write a program that instantiates four sphere objects (assigning a radius to each instance) and adds them to a pointer-based linked list. Include a function to display the statistics of each sphere in the list.

  Create object-oriented design to enter name into text box

Create the object-oriented design for the system which permits the user to enter their name into the text box. When they press Go button message.

  Program to create an exit button.

Create a Clear button to clear the result text box and reset both NumericUpdown controls.

  Develop an external css to provide style to an html document

Cascading Style Sheets are used to provide style, presentation, and layout for the HTML content of a Web page. You will develop an external CSS to provide.

  Implement a single pole-filter design program

This lab requires you to use C++ class composition to implement a single pole-filter design program. The program will allow the user to specify resistor and capacitor values and filter type

  Create database tables in mysql

Write the SQL command to find any tutors who have not submitted a report for July

  Create a program for a pizza shop

You are tasked with creating a program for a pizza shop - however, as this is a comparative languages course, you will be creating the same application in the following programming languages:

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