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
Spreadsheets are sometimes credited with legitimizing the personal computer as a business tool. Why do you think they had such a
Paladinen [302]

Spreadsheets is known to be an credited tool with legitimizing the personal computer as a business tool. Spreadsheets have a lot of impact in business world because:

  • It has low technical requirement. Here, spreadsheet does not need a complex installation and it is easy to understand.
  • Data Sifting and Cleanup is very easy to do.
  • It is a quick way to Generate Reports and Charts for business.

<h3>What is Spreadsheets?</h3>

Spreadsheets is known to be a key  business and accounting tool. They are known to have different complexity and are used for a lot of reasons.

The primary aim of this is that it helps us  to organize and categorize data into a kind of logical format and thus helps us to grow our business.

Learn more about Spreadsheets from

brainly.com/question/4965119

8 0
2 years ago
Which is the best programming practice?
irina [24]

Answer:

Open a file when the program needs to work with it and close the file as soon as you have finished using it.

Explanation:

In programming, we have some files that are stored in memory, or created in some other section of the program to save information.

<u><em>for example</em></u>, we want to save the data of a class or school faculty to create a database. For this purpose I need to create a file.

As the files that we will create may contains data, these files will utilize computer resources such as, memory (RAM, Cache) and other resources. While programming, we need these resources as well.

<em>Therefore, It is necessary to open a file when the program needs to work with it and close the file as soon as we have finished using it. The reason is that, it takes computer resources which are limited.    </em>

4 0
2 years ago
How to use access?<br> like working in access and bringing tables and stuff
zheka24 [161]

I would recommend first familiarizing yourself with the program Access by watching introductions.

If you have even more time to spare and want hands-on experience, use Wise Owl exercises. Search up college classes assignments or guides. (Boy, do they love their big workbooks.) Essentially, do practice exercises.

5 0
2 years ago
In the program below, which two variables have the same scope?
bagirrra123 [75]

Answer:

rhymeWord

Explanation:

correct answer edge 2020

3 0
3 years ago
Read 2 more answers
A computer supply company is located in a building with three wireless networks.
Sonja [21]

Answer:

A. Rogue access point

Explanation:

A rogue access point is defined as a wireless access point installed on a secure network infrastructure without consent of the owner of the network or without due authorization. While this can sometimes be added by a malicious attacker, it is most commonly set up by employees with the desire to have wireless access even when there is any available.

In the question, there are three wireless networks, but on scanning, five wireless networks were found, hence they are rogue access point.

3 0
3 years ago
Other questions:
  • What is a common source of connection problems with ethernets?
    9·2 answers
  • A ____________ variable is available throughout a program.
    7·1 answer
  • The part of the computer that provides access to the internet is the-?
    15·2 answers
  • What occurs when you call a method on a reference variable that contains null? Select one: a. An ArrayIndexOutOfBoundsException
    11·1 answer
  • Assign jsonData with the parsed value of the stringData variable. Then, assign 29 to the points property in jsonData and assign
    13·1 answer
  • What task does the casting director do, apart from auditioning actors?
    8·1 answer
  • Which operating system is a version of Linux?​
    13·1 answer
  • Can anyone fill in the space please
    6·1 answer
  • Describe the importance of human interaction in a computing system.
    14·2 answers
  • What is the minimum ethernet frame size that will not be discarded by the receiver as a runt frame?.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!