Fill This Form To Receive Instant Help

Help in Homework
trustpilot ratings
google ratings


Homework answers / question archive / Write the answers to the following questions

Write the answers to the following questions

Computer Science

Write the answers to the following questions.

Q.3.1 Explain why an out of bounds error message may be generated when using arrays. (2)

 

Q.3.2 Distinguish between a sequence structure and a decision

structure.

(4)

 

Q.3.3 In programming terms, what is a token? (2)

 

Q.3.4 What are the four keywords used in a Switch Statement? (4)

 

Q.3.5 Explain what a Run-Time Error is. (2)

 

Q.3.6 What does the following code output?

int x = 8;

int y = 2;

while(x > 8) {

 x--;

 y+=2;

}

System.out.println(y);

(2)

 

Q.3.7 What does the following code output?

System.out.println((2 + 3 - 5) * (3 / 3) + (5+5));

(2)

Q.3.8 What does the following code output?

if((2 == 2) && (3 != 3) && ((5 + 1)==6)){

 System.out.println(true);

}

else {

 System.out.println(false); 

 

Question 4

Debug the section of code that follows. Check the code carefully for all errors and list the line

numbers, the errors and write the corrections to the errors as well.

Line 1 public class Watches {

Line 2 private WatchMake;

Line 3 private string SalesPerson;

Line 4 private double WatchPrice;

Line 5

Line 6 public Watches(String make String salesPerson, double price) {

Line 7 WatchMake = make;

Line 8 SalesPerson = salesPerson ;

Line 9 WatchPrice = price

Line 10 }

Line 11 public String getWatch {

Line 12 return WatchMake;

Line 13 }

Line 14 public double getWatchPrice() {

Line 15 send WatchPrice;

Line 16 }

Line 17 public double getCommission() {

Line 18 double pay_out >> 0.0;

Line 19 pay_out = WatchPrice *= 0.10;

Line 20 return pay_out;

Line 21

Line 22 }

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE