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
KonstantinChe [14]
3 years ago
11

(1) Prompt the user to input an integer, a double, a character, and a string, storing each into separate variables. Then, output

those four values on a single line separated by a space. (2 pts) Note: This zyLab outputs a newline after each user-input prompt. For convenience in the examples below, the user's input value is shown on the next line, but such values don't actually appear as output when the program runs. Enter integer: 99 Enter double: 3.77 Enter character: 2 Enter string: Howdy 99 3.77 z Howdy (2) Extend to also output in reverse (1 pt) Enter integer: 99 Enter double 3.77 Enter characteri Enter string: Howdy 99 3.772 Howdy Howdy z 3.77 99 (3) Extend to cast the double to an integer, and output that integer (2 pts) 0 en soa Enter integer: 99 Enter double: 3.77 Enter character: 2 Enter string: Howdy 99 3.77 z Howdy Howdy z 3.77 99 3.77 cast to an integer is 3 LAB ACTIVITY 14.1.1: Prog 1: Variables, input, and casting 0/5 BasicInput.java Load default template. 1 ort java.util.Scanner: 2 3 lic class Basic Input I 4 public static void main(String args) { 5 Scanner ser-new Scanner(System.in); 6 int userint; 7 double userDouble; B // FTOME Define chor and string variables similarly 9 char UserChar: 10 String userString: 11 12 System.out.println("Enter integer"): 13 user Int - ser.nextInto: 14 15 // FTXMC (1): Finish reading other items inte variables, then output the four values on a single line separated by a space
Computers and Technology
1 answer:
Alex787 [66]3 years ago
6 0

Answer:

import java.util.*;

public class Main{

public static void main(String[] args) {

    Scanner input = new Scanner(System.in);

 int intgVal; double dblVal; char chrVal; String strVal;

 System.out.print("Enter integer: ");  

 intgVal = input.nextInt();

 System.out.print("Enter double: ");  

 dblVal = input.nextDouble();

 System.out.print("Enter character: ");  

 chrVal = input.next().charAt(0);

 input.nextLine();

 System.out.print("Enter string: ");  

 strVal = input.nextLine();

 System.out.println(intgVal+" "+dblVal+" "+chrVal+" "+strVal);

 System.out.println(strVal+" "+chrVal+" "+dblVal+" "+intgVal);

 int IntValue = (int) dblVal;

 System.out.print("Cast to an integer: "+IntValue);

}

}

Explanation:

See attachment for complete program where comments were used to explain each line of the program

Download txt
You might be interested in
What is the most important factors to consider when designing a powerpoint presentation?
balandron [24]
It is always helpful to choose a template, and an attractive theme to begin with. Next, display only the keywords or phrases that you need in your PowerPoint. This will help it look less boring (if its a whole paragraph of writing, it looks boring). Lastly, it is important to add visuals or images to your PowerPoint. Google Slides is also very convenient to use. Please message me if you have any other concerns! 
3 0
3 years ago
Read 2 more answers
A customer has a system with a Gigabyte B450 Aorus Pro motherboard. He wants to upgrade the processor from the AMD Athlon X4 950
AleksandrR [38]
This upgrade will make a big improvement from his AMD Athalon X4 950 to the AMD Ryzen 7 2700X this is because the system will have more gigabytes and a better processor
3 0
3 years ago
Read 2 more answers
Knowledge management software helps companies preserve the knowledge gained through the use of information so that future users
V125BC [204]

Answer:True

Explanation:

Knowledge Management (KM) software is software that assists with the identification, creation, distribution, and organization of a company’s knowledge pool. KM software, at its best, gives a company a single, unified pool of information that is easily

(1) accessible

(2) discoverable

(3) updated

KM software is meant to make companies leaner, efficient, and more profitable. But a number of challenges exist which make that easier said than done. Let’s look at a few of the primary challenges that make KM software so important for businesses—but so difficult to get right.

8 0
2 years ago
Read 2 more answers
CS provides a standardized approach to the command, control, and coordination of _______ emergency personnel.
bekas [8.4K]

Answer:On-scene emergency

Explanation: ICS(Incident Command System) is the the safety system which works on certain command in the time of emergency. It functions on the steps like controlling the on-scene emergency and coordinating it with the help of command and efficient resources.

This system provides the benefit of maintaining the security and safety of the on-scene individuals like workers, students etc.

8 0
3 years ago
What are some legal issues that can arise from the use of all social media?
Salsk061 [2.6K]

Answer:

  1. Copyright
  2. Defamation
  3. Cyberbullying

Explanation:

The first issue, that I would like to explain is Copyright. If you are imposing as a company on Social Media with a real name that is Copyrighted, the company will file a DMCA takedown notice which is the Digital Millennium Copyright Act

. Which can result in your Social Media being taken down, or by getting a fine, sued or even jailtime.

The second issue is Defamation, what Defamation is basically spreading false information about a company / business in real or online that hurts a companies reputation. If you commit this crime online you can face a lawsuit or even jailtime for one year.

Thirdly, cyberbullying. This is illegal in most states in the US. Cyberbullying is a serious matter and depending on your states laws can be charged with criminal harassment.

Sources:

Quora: (Website)

Miclaw: (Website)

Statista: (Website)

7 0
2 years ago
Other questions:
  • Whichmultiplexing technique involves signals composed of lightbeams?
    10·1 answer
  • If I make a Zoom Meeting, would you join it?
    7·2 answers
  • Which of the following menu commands would you select to make a copy of an open file and rename it?
    15·1 answer
  • 8. A pattern of being late for work or for appointments is usually
    12·1 answer
  • Which line in the following program contains the header for the showDub function? 1 #include«iostream» 2 using namespace std; 4
    15·1 answer
  • Find some search engine as many that you can find
    9·1 answer
  • Does anyone know a way to skip the videos on Edgnuity?
    15·1 answer
  • What simple machine is most often used to lift the blinds on a window?
    8·2 answers
  • -(-13) P binary using signed. 2's complement representation
    11·1 answer
  • The navigation bar appears in the same position on each page and uses the same colors, fonts, and font styles.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!