subject

Fix the 2 error codes. 1 // DebugSix2.java
2 // Display every character between Unicode 65 and 122
3 // Start new line after 20 characters
4 public class DebugSix2
5 {
6 public static void main(String args[])
7 {
8 char letter;
9 int a;
10 final int MIN = 65;
11 final int MAX = 122;
12 final int STOPLINE1 = 85;
13 final int STOPLINE2 = 122;
14 for(a = MIN; a <= MAX; a++)
15 letter = (char)a;
16 System. out. print(" " + letter);
17 if((a == STOPLINE1) & (a == STOPLINE2))
18 System. out. println();
19 System. out. println("\nEnd of application")
20 }
21 }
1 // DebugSix4.java
2 // Displays 5 random numbers between
3 // (and including) user-specified values
4 import java. util. Scanner;
5 public class DebugSix4
6 {
7 public static void main(String[] args)
8 {
9 int high, low, count;
10 final int NUM = 5;
11 Scanner input = new Scanner(System. in);
12 // Prompt user to enter high and low values
13 System. out. print("This application displays " + NUM +
14 " random numbers" +
15 "\nbetween the low and high values you enter" +
16 "\nEnter low value now... ");
17 low = input. nextInt();
18 System. out. print("Enter high value... ");
19 high = input. nextInt();
20 while(low == high)
21 {
22 System. out. println("The number you entered for a high number, " +
23 high + ", is not more than " + low);
24 System. out. print("Enter a number higher than " + low + "... ");
25 high = input. nextInt();
26 }
27
28 while(count < low)
29 {
30 double result = Math. random();
31 // random() returns value between 0 and 1
32 int answer = (int) (result * 10 + low);
33 // multiply by 10 and add low -- random is at least the value of low
34 // only use answer if it is low enough
35 if(answer <= low)
36 {
37 System. out. print(answer + " ");
38 ++count;
39 }
40 }
41 System. out. println();
42 }
43 }

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 23:50
You need to design a circuit that implements the functions in the following table: s0 s1 function0 0 a + 10 1 a – b1 0 a + b1 1 a – 1s0 and s1 are 1-bit control inputs to select the function of the circuit. inputs a and b are 4-bitnumbers in 2s complement form. the output is also a 4-bit number in 2s complement form.you are allowed to use only one ttl 7483 4-bit adder to implement all the functions. but anynumber of other components (except the adder) can be used.hint: design a combinational logic circuit to modify the input b and the “carry input” of theadder depending on the control inputs s0 and s1.important: lab grade will depend on the working of the circuit & will be checked of by your labinstructor.1. is the output valid for the following input combinations: a. s0 = 0, s1 = 0, a = 7, b = 3? b. s0 = 0, s1 = 1, a = 7, b = 3? c. s0 = 1, s1 = 0, a = -4, b = -5? d. s0 = 1, s1 = 1, a = -8, b = 6? 2. what is the range of inputs (for both a and b) that will produce the valid output for all the functions?
Answers: 3
question
Computers and Technology, 23.06.2019 21:20
In microsoft word, when you highlight existing text you want to replace, you're in              a.  advanced mode.    b.  automatic mode.    c.  basic mode.    d.  typeover mode
Answers: 1
question
Computers and Technology, 24.06.2019 10:20
Write a program that keeps asking the user for new values to be added to a list until the user enters 'exit' ('exit' should not be added to the list). these values entered by the user are added to a list we call 'initial_list'. then write a function that takes this initial_list as input and returns another list with 3 copies of every value in the initial_list. finally, inside print out all of the values in the new list. for example: input: enter value to be added to list: a enter value to be added to list: b enter value to be added to list: c enter value to be added to list: exit output: a b c a b c a b c note how 'exit' is not added to the list. also, your program needs to be able to handle any variation of 'exit' such as 'exit', 'exit' etc. and treat them all as 'exit'.
Answers: 2
question
Computers and Technology, 24.06.2019 12:30
Why does the pc send out a broadcast arp prior to sending the first ping request
Answers: 1
You know the right answer?
Fix the 2 error codes. 1 // DebugSix2.java
2 // Display every character between Unicode 65 an...
Questions
question
Mathematics, 05.04.2020 17:31
question
Mathematics, 05.04.2020 17:32
question
History, 05.04.2020 17:35
question
Mathematics, 05.04.2020 17:35
question
Mathematics, 05.04.2020 17:36
question
Engineering, 05.04.2020 17:36
Questions on the website: 13722359