首页 > > 详细

辅导 ICS3UO - Computer Science - Exam - Sem 2 - 2024-2025调试数据库编程

ICS3UO - Computer Science - Exam

Date(s): June 18, 2025-June 24th 2025 (Approximate time 1.5 hours)

Overview

All of your work will be done online. You must have your FileZilla / Web Browser / and Sublime Text (or similar software) available as well as an Internet connection.

Follow the instructions carefully for naming the files that you will upload and list on your index page that you were using for the course. Each of the pages that you make, must be a properly formatted html page with title tags, header, body, etc. You can style. as you wish,l but more marks go to performance and functionality over style-so you don't have to spend as much time on that part.

Stand-alone FileZilla and Sublime Text (zip packages-not the installers)

Sublime Text

FileZilla

*You may use your existing code and the Internet as reference for this test.

Question 1

Upload the code below to a page called: exam-q1.php-upload and test the file; you will notice there are multiple errors within the script. Go through this and fix all of the errors so that thel page displays and works properly. Basically the user inputs a number between 1 and 10 and if they guess the random number correctly, otherwise it tells them they are wrong.

In a short paragraph (or jot dots) on your page, indicate where the errors were and briefly why they are errors.

Upload this code with your fixes to show it works. Trouble shoot to get it to work.

Question 2

Create a file called: exam-q2.php. What's the Average Temperature?: Given the base code below...you will create a for loop that will output the numbers from the array and keep track of the total sum. After the loop is done you will display the sum and then calculate the average temperature. (note: using sizeof() function to get the size of the array will be needed). Level 4: include a single input field where the user can input the string (separated by commas) and the average will be calculated. If the average temperature is below O", output "Brrr, it was cold!" and if over 30° "Whew! It was hot!" Include error checking as well.

Question 3

Create a file called: test-q3.php. Cutting Paper: A very large piece of paper has a approximate thickness = 0.00009m, and is cut in half and the pieces stacked together, and then cut again, etc., what will the thickness be after x number of cuts? Show the thickness after each cut.

Create an application that allows the user to enter in the number of cuts, x, to be made. The cuts must range from 1 to 100 maximum. Error checking must be included and the output should display each iteration of the loop.

The equation is: (2")*0.00009 where n is the cut number. Use the PHP function pow(2,$n) which is equivalent to: 2".

Your output should be in table form, not text like below. Error checking required.

Sample output

User input: 3

After cut 1 the thickness is 2*0.00009= 0.00018 m

After cut 2 the thickness is 4*0.00009= 0.00036 m

After cut 3 the thickness is 8*0.00009= 0.00072 m

Fun Fact

A user input of 22 results in a final height of about 377 m. So cutting and stacking just 22 times the paper would stack to a height almost as tall as the CN tower (550m)

Question 4

Create a file called: exam-q4.php. Balanced Lever: A lever is balanced if the force x distance (or F*d) from the fulcrum is the same on both sides of the fulcrum.

You will require user inputs (3 for forces and 3 for the distances) and a submit button.

Given three forces and distances (using +to denote a force on the right of the fulcrum and - to denote the force on the left of the fulcrum state if it is balanced or not.

Error checking- make sure no input is empty (they can be zero)




联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!