1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Pie
4 years ago
6

What is wrong with the following switch statement? int ans; System.out.print("Type y for yes or n for no"); ans = scan.nextInt()

; switch (ans) { case 'y': case 'Y': System.out.println("You said yes");break; case 'n': case 'N': System.out.println("You said no");break; default: System.out.println("invalid answer"); }
Computers and Technology
1 answer:
klemol [59]4 years ago
8 0

Answer:

In this question the ans variable data-type is int,that is wrong.

Explanation:

In the above code the ans variable int that is used for taking integer value. and In the switch statement, we pass the value that is character so the program will give the error. To solve this error we will declare the ans variable as char and taking input from the scanner class like this (ans = scan.next().charAt(0); )where ans is variable, scan is the object of scanner class and next().charAt(0) is used to take input. that is store in ans variable.

You might be interested in
"In about 100 words, discuss the technologies that Walmart’s trucking fleet might use to better manage their operations. Include
Sergio [31]

Answer:

The answer to this question can be described as follows:

Explanation:

The term Tracking technology is divided into two parts first tacking and technology, in which Tracking is being used to increase or decrease the frequency of both the document on one page by increasing or growing the distance among letters, and technology is how we use engineering for intensive purposes.

  • The technology of tracking It is very the fusion of many innovations, that can also be combined to build machines, which follow the material, stock or even the fleets of vehicles. A delivery of situation-based services to wireless networks can be achieved by similar programs.
  • The principal aim is to look at individuals or items on the movement and to provide for the further analysis a timely ordered locational sequence of details.
3 0
3 years ago
Which of the following is not a true statement? a. Data flow diagrams and flowcharts are difficult to prepare and revise using s
Nimfa-mama [501]

Answer:

a. Data flow diagrams and flowcharts are difficult to prepare and revise using software packages.

Explanation:

A data flow diagram is a graphical description of the source and destination of data that shows how data flow within an organization.

Documentation tools are used extensively in the systems development process.

Data flow diagrams and flowcharts are the two most frequently used systems development documentation tools. Also, documentation tools save an organization both time and money.

7 0
3 years ago
A tree can grow on rock as long as its roots can reach soil through cracks in the rock.
ycow [4]
I would say the answer is c
3 0
4 years ago
The most accurate reading that you can take on an analog vom are when the meters pointer is at the?
marshall27 [118]
<span>The most accurate readings are near the right end of the scale, for two reasons. Any inaccuracy in your reading is a smaller part of the total voltage near full scale, and readings near the left end are likely to be off because of incorrect adjustment of the zero adjust screw. If "extreme right" means past the end of the numbers, you may be off there if the needle hits the stop. On meters with a mirror behind the needle, move to where the needle is in front of its reflection for the best reading.</span>
4 0
4 years ago
Which is the correct option?
Murljashka [212]

Answer:

C

Explanation:

Key logging is when a hacker can track every key u have clicked.

3 0
3 years ago
Other questions:
  • If there is no index.html file in the root folder nothing will be displayed when you navigate to the site address
    14·1 answer
  • He has a new Wi-Fi router that connects wirelessly to a new desktop and two new laptops, in addition to multiple smartphones, ta
    8·1 answer
  • How can this be achieved? Universal Containers stores invoices in SAP. Users want to view invoice data onthe related Account rec
    9·1 answer
  • This function causes a program to terminate, regardless of which function or control mechanism is executing.
    12·1 answer
  • The numbering system we commonly use is called the decimal numbering system because it uses ________ symbols to represent all po
    5·1 answer
  • When is padding required for a structure type variable? Group of answer choices When the structure contains a word-type variable
    9·1 answer
  • Assume that sentence is a variable that has been associated with a string consisting of words separated by single space characte
    5·1 answer
  • ________ is the use of information technology to support the sharing of content among networks of users.
    14·1 answer
  • During the post process,the Bios uses two different ways to notify you of a problem. Error beep codes and error messages .Explai
    10·1 answer
  • Find the name of the professor with the maximum percentage of students that failed his course.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!