Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

QUESTION 3 A. Write a segment of server script that receive a vegetable's name from user input and thern display the colour of the vegetable.

image text in transcribed

QUESTION 3 A. Write a segment of server script that receive a vegetable's name from user input and thern display the colour of the vegetable. The available vegetables with colours are showing in the Table 1.1. For any vegetable that is not in the list, display "Unknown" for the colour Vegetables Colour Cucumber Green Pumpkin Orange BroccoliGreen Tomato Red BeetrootPurple Pe Yellow Table 1.1 a) Using if...else statement b) Using switch statement Save the document as VegetableColours.php Write a function definition called findSum () that determine the total of sum by adding a number in k-times. The two inputs (an integer number, num and k-times, k) are the parameter of the function. The function should return the result once completed. Write a segment of script to test run your function. Save the document as FindSumValues.php Write a script to remove the dash (-) that found in between the number of Malaysian Identification Card (MyKad). Write a function icDashRemover ) that receive an IC number, return the IC number without the dash and the gender. You are required to test the function with two inputs below icNo1: 570822-05-4564 icNo2: 610101-11-5327 Save the document as IcDetails.php Write functions with the use of random function (rand ()) to answer the questions below a)A function genEvenNumber ) that able to produce an even number between 10 to b) A function genMultiple5 that able to generate 10 numbers in multiple of 5 Save the document as Random Functions.php 50 between 1000 to 2000

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introductory Relational Database Design For Business With Microsoft Access

Authors: Jonathan Eckstein, Bonnie R. Schultz

1st Edition

1119329418, 978-1119329411

More Books

Students also viewed these Databases questions

Question

Understand why customers complain.

Answered: 1 week ago