Question

3. Write a function that displays the following table... 4. 6 7 8 9 10 11 12 13 14 15 4. Write a function that displays output according to this table. Pass in a floating point value, assumed to be a star rating. Use decisions. Consider using a switch if you have no experience with switches! ating 0 0-2.5 2.5-4 4-5 Mes Terrible Not Great Alright 3
Netflix Assignment 3- ICS 225-02 Web x n.minnstate.edu/d2/le/content/4210617/viewContent/36118253/Niew + Assignment #3 JavaScript Problems. I have a pile of JavaScript problems for you in this assignment. Do all of these. You may throw themall one file with your nam function for me in the file itself so its easy for m console.log). If youve had 141 already, these should be cake. If not, they might be a bit tougher in e at the top as a comment. Do each problem as its own function, and call each e to test! When I say print/display, use 1. Make a function that takes in a single input assumed to be an integer. Run a for loop that prints HI BOB an amount equal to that integer 2. Do the same, but pass two parameters, the amount and a message to be displayed. Instead of HI BOB, print the passed message the desired amount of times
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Question 3:

3. Write a function that display the following table

1 2 3 4 5

6 7 8 9 10

11 12 13 14 15

<html>
<head>
<title>Table Creation !!</title>

<script type="text/javascript">

function tableInfo()
{
var r,c,k;
k=1;

for(r=1;r<=3;r++)
{
for(c=1;c<=5;c++)
{
document.write(k+" ");
k++;
}
document.write("<br>");
}
}

</script>
</head>
<body>
<script type="text/javascript">
tableInfo();  
</script>
</body>
</html>

Question 4.

<html>
<head>
<title>Decisions </title>
<script type="text/javascript">
function decisions(no)
{
if(no==0)
{
console.log("Terrible");
}
else if(no>=0 && no<2.5)
{
console.log("Not Great");
}
else if(no>=2.5 && no<4)
{
console.log("Alright");
}
else if(no>=4 && no<5)
{
console.log("Dope");
}
}

</script>
</head>
<body>
<script type="text/javascript">
var no;
no=parseFloat(prompt("Enter a float : "));
decisions(no);
</script>
</body>
</html>

Assignment # 3 :

<html>
<head>
<title>JavaScript Assignment</title>
<script type="text/javascript">

console.log("Function with one parameter : ");
function show1(no1)
{
var i;
for(i=1;i<=no1;i++)
{
console.log(i+". HI BOB");
}
}

console.log("Function with two parameter : ");

function show2(no2,msg)
{
var i;
for(i=1;i<=no2;i++)
{
console.log(i+". "+msg);
}
}
</script>
</head>

<body>
<script type="text/javascript">
var no1,no2,msg;

no1=parseInt(prompt("Enter an Integer : "));
show1(no1);

no2=parseInt(prompt("Enter an Integer : "));
msg=prompt("Enter a message : ");
show2(no2,msg);
</script>
</body>
</html>

Add a comment
Know the answer?
Add Answer to:
3. Write a function that displays the following table... 4. 6 7 8 9 10 11...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • please help. thank you! Total Question 12 3 4 5 6 7 8 9 10 11...

    please help. thank you! Total Question 12 3 4 5 6 7 8 9 10 11 1213 14 15 16 | 435(11.4%) 12 -/1 -/1 -8-6-6-/1 -3-13 ㅢ1-1 0/3 1/1 0,1 Points Assignment Submission For this assignment, you submit answers by question parts. The number of submissions remaining for each question part only cha Assignment Scoring Your last submission is used for your score. 4. 0/1 points I Previous Answers OSPreCalc1 8.1.041 Find the measure of angle x, If possible....

  • - Data Table for Problems 14.17 through 14.19* Period 1 2 3 4 5 6 7 8 9 10 11 12 requirements 30 ...

    please answer 14.17 - Data Table for Problems 14.17 through 14.19* Period 1 2 3 4 5 6 7 8 9 10 11 12 requirements 30 40 30 70 20 10 80 50 8 "Holding cost $2.50/unit/week; setup cost $150; lead time 1 week; beginning n Gross inventory 40 m14.17 Develop a lot-for-lot solution and calculate total rel- s evant costs for the data in the table for Problems 14.17 through d 14.19. Px 14.18 Develop an EOQ solution and...

  • Program 7 File Processing and Arrays (100 points) Overview: For this assignment, write a program that...

    Program 7 File Processing and Arrays (100 points) Overview: For this assignment, write a program that will process monthly sales data for a small company. The data will be used to calculate total sales for each month in a year. The monthly sales totals will be needed for later processing, so it will be stored in an array. Basic Logic for main() Note: all of the functions mentioned in this logic are described below. Declare an array of 12 float/doubles...

  • Time Value of Money Spreadsheet Example 4 Module IV Name: Date: 6 7 8 Question 1 9 Question 2 10 Question 3 11 Question...

    Time Value of Money Spreadsheet Example 4 Module IV Name: Date: 6 7 8 Question 1 9 Question 2 10 Question 3 11 Question 4 12 Question 5 13 Question 6 14 Question 7 15 Question 8 16 Question 9 17 Question 10 18 19 20 Single Amount or Annuity 21 Periodic Interest Rate 22 Number of Periods 23 24 25 Present Value of Single Amount 26 27 Future Value of Single Amount 28 29 Future Value of An Annuity...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT