Screenshot_2
.png
keyboard_arrow_up
School
Austin Community College District *
*We aren’t endorsed by this school
Course
2317
Subject
Computer Science
Date
Dec 6, 2023
Type
png
Pages
1
Uploaded by ChancellorBoulder12683 on coursehero.com
Question
5
0
out
of
4
points
When
you
compile
your
Java
assignment
program,
you
may
see
the
following
on the
screen:
Note:
....
java
uses
unchecked
or
unsafe
operations.
Note:
Recompile
with
-Xlint:unchecked
for
details.
This
is
a
critical
error
that
cannot
be
tolerated
in
this
course.
You
must
correct
your
program
to
eliminate
the
error
before
submitting
the
assignment.
Selected
Answer:
Q
True
Correct
Answer:
@
False
Response
Feedback:
When
you
compile
your
Java
program,
you
may
see
the
following
on
the
screen:
Note:
....
java
uses
unchecked
or
unsafe
operations.
Note:
Recompile
with
-Xlint:unchecked
for
details.
This
is
a
warning,
and
is
not an
error.
As
far
as
Prof.
Baldwin
is
concerned,
you
can
simply
ignore
the
warning
in
this
course.
You
will
learn
how
to
deal
with
this
issue
in
a
later
course.
Question
6
0
out
of
4
points
You
must
submit
your
Java
source
code
files,
class
files,
and
image
files
encapsulated
in
a
zip
file
when
you
submit
an
assignment.
m
Selected
Answer:
@
True
Correct
Answer:
@
False
Response
Feedback:
You
must
submit
only
your
Java
source
code
files
encapsulated
in
a
zip
file
when
you
submit
an
assignment.
Do
not
submit
class
files
or
image
files.
Question
7
4
out
of
4
points
The
primary
learning
resource
for
this
course
is
a
book
titled
"Learn
Java
OOP
in
21
Days.”
Selected
Answer:
@
False
Correct
Answer:
@
False
Question
8
4
out
of
4
points
For
each
assignment,
Prof.
Baldwin
will
provide
you
with
the
set
of
class
files
produced
by
his
version
of
the
program
so
that
you
can
run
his
version
to
observe
the
output.
He
recommends
that
you
run
his
version
(from
the
command
line)
side-by-side
with
your
version
and
compare
the
two
before
submitting
your
assignment.
Selected
Answer:
@
True
Correct
Answer:
@&
True
Discover more documents: Sign up today!
Unlock a world of knowledge! Explore tailored content for a richer learning experience. Here's what you'll get:
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
Note: Please answer the question in Java only:
The Problems - contains only problems from the last 2 contests
Separate Un-Attempted, Attempted and All cards Problem Difficulty Rating - The
Featured drop-down menu has different difficulty ranges so you can try problems that
best suit your experience.
Popular topics and brands Like most users, Chef didn't know that he could add
problems to his personal to-do list by clicking the magic "+" symbol in the upper
right corner of each problem page. But once he found out about it, he went crazy and
added a lot of problems to his to-do list without looking at their difficulty rating.
Rajesh is a beginner and ideally should only try to solve problems strictly below
10001000. Given the difficulty rating list of problems in Chef's to-do list, please help
him determine how many of these problems Chef should remove from his to-do list
so he is left with only problems with a difficulty rating of less than 10001000.
Input
1
4
999 1000 1001 1002
Output…
arrow_forward
Small Program assignment based on basic java features (Class, Object, Constructor, Method, Output, If-else, Loop, Array Etc)
Note: USe all the topic what mention in above and dont copy from bertlyby .i post this question 3rd time so please give me correct answer
arrow_forward
New java code can only be entered lines 4 - 10.
arrow_forward
basic java code, self-learner here so pls do use more // comments ya if needed
pls label the solution with the question label
arrow_forward
Problem:
Bugs are simple creatures that only know how to walk towards other bugs. Bugs maintain
information about their (x, y) position; by which it can tell if they are standing next to other bugs.
Watch the following video: bug movement.
Create a java project that simulate bugs movement. You need to write a class “Bug" that models a
bug moving along a straight line and it can turn to change its direction counterclockwise (i.e. 90
degree to the left; north → west → south → east → north). In each move, its position changes by
one unit in the current direction. Details of the "Bug" class is described below.
Your simulator should read information of an unknown number of “Bug" objects from an input
file called “Bugs.txt". Each line represents a bug and the initial position and facing direction of this
particular bug. Keeping the first bug position as a reference the simulator should move the second
bug next to the first bug forming a cluster and its final position and direction should be…
arrow_forward
Java Question - For some reason, my code seems to always output an error in the Java Compiler. I am not sure what's the mistake. If you could fix the problem, I would appreciate it. The code and error message is in the pictures. Thank you.
arrow_forward
Cannot compile on java the problem is chapter 5, PC #10 page 346 in starting out with java early objects version 6 by Tony Gaddis. I believe that there is a bracket missing in the text on your site as I keep getting a parsing error at the final line of the code on the "Test" program. I have tried to place it where I thought it should belong but that just caused more errors. I will attach the code to this request
arrow_forward
ompiling and Executing a Java Program
Summary
In this lab, you compile and execute a prewritten Java program.
Instructions
Execute the program. There should be no syntax errors.
Modify the program so it displays "I'm learning how to program in Java.". Execute the program.
Modify the Programming class so it prints two lines of output. Change the class name to Awesome. In Java, the file name must match the class name, so change the file name to Awesome.java. Add a second output statement that displays "That's awesome!". Execute the program.
arrow_forward
Writing a Modular Program in Java
Summary
In this lab, you add the input and output statements to a partially completed Java program. When completed, the user should be able to enter a year, a month, and a day to determine if the date is valid. Valid years are those that are greater than 0, valid months include the values 1 through 12, and valid days include the values 1 through 31.
Instructions
Notice that variables have been declared for you.
Write the simulated housekeeping() method that contains input statements to retrieve a year, a month, and a day from the user.
Add statements to the simulated housekeeping()method that convert the String representation of the year, month, and day to ints.
Include the output statements in the simulated endOfJob()method. The format of the output is as follows:month/day/year is a valid date. or month/day/year is an invalid date.
Execute the program entering the following date: month = 5, day = 32, year =2014Observe the output of this…
arrow_forward
Grey lines (start-13 & 17-end of code) can NOT be changed.
New JAVA code must go inbetween code
arrow_forward
Instructions
The files provided in the code editor to the right contain syntax and/or logic errors. In each case, determine and fix the problem, remove all syntax and coding errors, and run the program to ensure it works properly.
An example of the program is shown below:
Enter name Juan Hello, Juan!
Task 1: The DebugThree3 class compiles without error.
Task 2: The getName() method accepts user input for a name and returns the name value as a String.
Task 3: The displayGreeting() method displays a personalized greeting.
Task 4: The DebugThree3 program accepts user input and displays the correct output.
arrow_forward
Part 4: Methods
The following is Java pseudocode. For this exercise, you can assume the input function provides an appropriate integer value. Line numbers are provided on the left. System.out.print will print the information to the same line. System.out.println will print the information and then go to the next line. // is a comment. Do not worry about public static. Code execution starts with the main method.
For each method used, make sure to provide a separate table showing what the values are and how they change (i.e. tracing through the code). All variables passed in have values. Don’t worry about showing how the input() method works.
7 public static int test1(int x1, int x2){ 8 9 if(x1==0){ 10 x1=10; 11 } 12 if(x2==0){ 13 x2=10 14 } 15 16 return x1*x2; 17 } 18 19 public static int test2(int x2, int x1){ 20 return x2-x1; 21 } 22 public static int input(){…
arrow_forward
new java code can only be added after line 17.
arrow_forward
I am trying to complete this assignment in Java.
arrow_forward
Cannot compile on java the problem is chapter 5, PC #10 page 346 in starting out with java early objects version 6 by Tony Gaddis. I believe that there is a bracket missing in the text on your site as I keep getting a parsing error at the final line of the code on the "Test" program. I have tried to place it where I thought it should belong but that just caused more errors. I will attach the code to this request. I keep getting an error of java 37: error: reached end of file while parsing. The last person said to just place another bracket at the end but that caused more than 20 errors.
arrow_forward
Do not attempt, if you are using other's work.
I'll give multiple dislikes for plagiarism and also will report your
account. Give unique answer others are wrong.
Question:
Write a Java program that takes user input for two numbers,
multiplies them, and prints the result. Ensure that your program is
user-friendly, handling different data types, and providing
meaningful output.
Submission Guidelines:
Use appropriate variable types for user input and the result.
Implement input validation to handle unexpected user inputs.
Print a clear and informative message along with the result.
arrow_forward
I need help with this question in my intro to Java class. I have included what I have so far but I am not getting what I should be and dont know what I am doing wrong.
arrow_forward
basic java code, self-learner here so pls do use more // comments ya if needed
pls label the solution with the question label
Just needed the the question b &c , a I have done
arrow_forward
OverviewIn this task, you should write a program that asks the user to enter one or more sentences. The program counts and prints on the screen how many sentences, words and characters the user wrote.
TaskWrite a java program that prompts the user to write a text with one or more sentences. The program will then print on the screen how many sentences, words and characters the user entered.
You can assume that:• one sentence:always ends with a period (.), an exclamation point (!), a question mark (?) or the user presses 'enter' on the keyboard.• words:always separated by a space () or the user presses 'enter' on the keyboard.• a sign:is any character in the text (string) that the user enters.Tip• StringTokenizer, String.split and / or Scanner.
Output attached by pic
arrow_forward
True or False
A Java method can be defined to accept a varying number of parameters.
arrow_forward
Program - Python
Make a class names Foo
Add a class variable to foo called x and initialize it to 5
Add an instance variable to foo called y and initialize it to 100
Make an instance of the class, call it f
Using f, print out the value of x
Print out the value of y
arrow_forward
JAVA
Problem description:You are to write a program called Seasons that prompts the user for a month and day and displays the season in which that date occurs. For reference, we will use the following date cutoffs for the various seasons:
Winter
December 21 – March 19
Spring
March 20th – June 20th
Summer
June 21st – September 20th
Fall
September 21st – December 20th
Data Validation
For this program, you'll write a specific method to perform data validation based on the month and day entered. More specifically:
Month – the month entered must be a valid month of the year (January – December).
Day – the day entered must be a valid day for that month:
January, March, May, July, August, October, December have 1-31 days.
April, June, September, November have 1-30 days.
February has 1-28 days (do not worry about leap years)
Required program decomposition
String getMonth(Scanner console)
This method is called from the main method and should prompt for the month as a string…
arrow_forward
JAVA: Why is it considered a good programming technique to make all instance variables private? How would you go about accessing those variables?
arrow_forward
The design pattern Singleton is mainly used to avoid the new
operator in Java.
True
O False
arrow_forward
JAVA: Why is making all instance variables private considered a good programming technique?
How would you go about obtaining access to those variables?
arrow_forward
What happened after the following Java code is run?
- Compiler error
- Exception
- This final exam is very easy will be displayed
- This final exam is easy will be displayed
arrow_forward
Can better code fix bugs in programming? Does this have a good or bad meaning?
arrow_forward
PART B: JUnit Testing Write a Java program according to the following: Create a Multiple.java class. Create the following two static methods (with return type float): SquareRoot() and CubeRoot(). SquareRoot) method should take two arguments and return the float value at the end. CubeRoot() method should take three arguments and return the float value at the end. Create a test class with the name MultipleTest.java. In this class, import the following libraries at the top of this file import org.junit. Before; import org.junit. Test; import static org.junit.Assert.assertEquals; Create an object of Calculator.java class by writing the following code in CalculatorTest.java class: private Multiple multiple; @Before public void setup() {this.multiple new Multiple():) 4. Generate the JUnit test classes for both the methods one by one. Declare and initialize the required variables to pass those to the methods. Store the expected result in one of the variables and then compare it with the…
arrow_forward
Discussion: chapter 4
Pick a method of debugging/error catching and explain how it works and give a real world example of how it works.
arrow_forward
the value of x after the code executes (java)
int x =0;
int i;
for (i=0; i,5; i++)
x=3*x+i;
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Related Questions
- Note: Please answer the question in Java only: The Problems - contains only problems from the last 2 contests Separate Un-Attempted, Attempted and All cards Problem Difficulty Rating - The Featured drop-down menu has different difficulty ranges so you can try problems that best suit your experience. Popular topics and brands Like most users, Chef didn't know that he could add problems to his personal to-do list by clicking the magic "+" symbol in the upper right corner of each problem page. But once he found out about it, he went crazy and added a lot of problems to his to-do list without looking at their difficulty rating. Rajesh is a beginner and ideally should only try to solve problems strictly below 10001000. Given the difficulty rating list of problems in Chef's to-do list, please help him determine how many of these problems Chef should remove from his to-do list so he is left with only problems with a difficulty rating of less than 10001000. Input 1 4 999 1000 1001 1002 Output…arrow_forwardSmall Program assignment based on basic java features (Class, Object, Constructor, Method, Output, If-else, Loop, Array Etc) Note: USe all the topic what mention in above and dont copy from bertlyby .i post this question 3rd time so please give me correct answerarrow_forwardNew java code can only be entered lines 4 - 10.arrow_forward
- basic java code, self-learner here so pls do use more // comments ya if needed pls label the solution with the question labelarrow_forwardProblem: Bugs are simple creatures that only know how to walk towards other bugs. Bugs maintain information about their (x, y) position; by which it can tell if they are standing next to other bugs. Watch the following video: bug movement. Create a java project that simulate bugs movement. You need to write a class “Bug" that models a bug moving along a straight line and it can turn to change its direction counterclockwise (i.e. 90 degree to the left; north → west → south → east → north). In each move, its position changes by one unit in the current direction. Details of the "Bug" class is described below. Your simulator should read information of an unknown number of “Bug" objects from an input file called “Bugs.txt". Each line represents a bug and the initial position and facing direction of this particular bug. Keeping the first bug position as a reference the simulator should move the second bug next to the first bug forming a cluster and its final position and direction should be…arrow_forwardJava Question - For some reason, my code seems to always output an error in the Java Compiler. I am not sure what's the mistake. If you could fix the problem, I would appreciate it. The code and error message is in the pictures. Thank you.arrow_forward
- Cannot compile on java the problem is chapter 5, PC #10 page 346 in starting out with java early objects version 6 by Tony Gaddis. I believe that there is a bracket missing in the text on your site as I keep getting a parsing error at the final line of the code on the "Test" program. I have tried to place it where I thought it should belong but that just caused more errors. I will attach the code to this requestarrow_forwardompiling and Executing a Java Program Summary In this lab, you compile and execute a prewritten Java program. Instructions Execute the program. There should be no syntax errors. Modify the program so it displays "I'm learning how to program in Java.". Execute the program. Modify the Programming class so it prints two lines of output. Change the class name to Awesome. In Java, the file name must match the class name, so change the file name to Awesome.java. Add a second output statement that displays "That's awesome!". Execute the program.arrow_forwardWriting a Modular Program in Java Summary In this lab, you add the input and output statements to a partially completed Java program. When completed, the user should be able to enter a year, a month, and a day to determine if the date is valid. Valid years are those that are greater than 0, valid months include the values 1 through 12, and valid days include the values 1 through 31. Instructions Notice that variables have been declared for you. Write the simulated housekeeping() method that contains input statements to retrieve a year, a month, and a day from the user. Add statements to the simulated housekeeping()method that convert the String representation of the year, month, and day to ints. Include the output statements in the simulated endOfJob()method. The format of the output is as follows:month/day/year is a valid date. or month/day/year is an invalid date. Execute the program entering the following date: month = 5, day = 32, year =2014Observe the output of this…arrow_forward
- Grey lines (start-13 & 17-end of code) can NOT be changed. New JAVA code must go inbetween codearrow_forwardInstructions The files provided in the code editor to the right contain syntax and/or logic errors. In each case, determine and fix the problem, remove all syntax and coding errors, and run the program to ensure it works properly. An example of the program is shown below: Enter name Juan Hello, Juan! Task 1: The DebugThree3 class compiles without error. Task 2: The getName() method accepts user input for a name and returns the name value as a String. Task 3: The displayGreeting() method displays a personalized greeting. Task 4: The DebugThree3 program accepts user input and displays the correct output.arrow_forwardPart 4: Methods The following is Java pseudocode. For this exercise, you can assume the input function provides an appropriate integer value. Line numbers are provided on the left. System.out.print will print the information to the same line. System.out.println will print the information and then go to the next line. // is a comment. Do not worry about public static. Code execution starts with the main method. For each method used, make sure to provide a separate table showing what the values are and how they change (i.e. tracing through the code). All variables passed in have values. Don’t worry about showing how the input() method works. 7 public static int test1(int x1, int x2){ 8 9 if(x1==0){ 10 x1=10; 11 } 12 if(x2==0){ 13 x2=10 14 } 15 16 return x1*x2; 17 } 18 19 public static int test2(int x2, int x1){ 20 return x2-x1; 21 } 22 public static int input(){…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT