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

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

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

  Programming assignment

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 to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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