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
Sever21 [200]
3 years ago
15

Given an integer variable i and a floating-point variable f, that have already been given values, write a statement that writes

both of their values to standard output in the following format:i=value=of-i f=value-of-fThus, if i's value were 25 and f's value were 12.34, the output would be:i=25 f=12.34but you don't know what i's value and f's value are. They might be 187 and 24.06. If that's what their values are, the output from your statement should be:i=187 f=24.06On the other hand, they might be 19 and 2.001. If thats what their values are, the output from your statment should be:i=19 f=2.001Remember: you are given i and f- that means they are already declared and they already have values! Don't change their values by assigning or initializing them! Just print them out the way we have shown above. Just write one statement to produce the output. Remember: in your output you must be displaying both the name of the variable (like i) and its value
Computers and Technology
1 answer:
Tju [1.3M]3 years ago
8 0

Answer:

System.out.println("i = " + i + " f = " + f);

Explanation:

The code above has been written using Java's syntax.

To print or display statements to the console, one of the methods to use is the System.out.println() method.

According to the question, the statement to output is i=value-of-i f=value-of-f which is a string of texts.

Note that value-of-i and value-of-f are already stored in variables i and f respectively. Therefore to print them as part of the string text statement, it is important to concatenate them using the "+" operator as follows:

"i = " + i + " f = " + f

If the value of i is 25 and the value of f is 12.34 then the above statement, after successful concatenation reads:

"i = 25 f = 12.34"

which can then be shown on the console using System.out.println() method as follows:

System.out.println("i = " + i + " f = " + f);

Hope this helps!

You might be interested in
Your son is complaining that his smartphone is broken. He tells you that he cannot connect to the internet, nor can he make or r
ycow [4]

Answer:

the correct and only reasonable answer is option B

3 0
2 years ago
How do you perceive the importance of Internet?
Igoryamba

The Internet had been used since the 1960's. The internet has capability of giving any answer you need or just having fun. If you want more, wikipedia the internet.

8 0
3 years ago
Read 2 more answers
Select the correct answer
DIA [1.3K]

Answer:

b

Explanation:

scan the images with 72DPI

5 0
3 years ago
What is the comment marker in Python? ("character marker" means the sequence of characters that indicates the beginning of a com
olga2289 [7]

Answer:

The # marker is used to mark a line comment in python.

Explanation:

The line that starts with # is a comment.Python will ignore the lines that starts with #.These comments can be used to add extra information in the python code.

For example:-

Following is the python code with comments.

names=['sam','optimus','bumblebee'] #names is the list of transformers characters.

for i in names:

     print(i)  #printing the names.

There are 2 comments in the python code written above.These are ignored by python.

6 0
4 years ago
Which type of choir often sings AND dances while they perform?
adelina 88 [10]
Advanced Choir multip

8 0
3 years ago
Other questions:
  • I want to message someone on Brainly but it wont let me. How many questions do I need to answer before I could message?
    12·2 answers
  • You have successfully compiled the file Hi.java, how do you run the corresponding program from the command line?
    7·1 answer
  • The actual database of Active Directory shared resources is stored on one or more computers designated as:
    6·1 answer
  • To what does the term computer hacking refer?
    10·2 answers
  • Send the memes whoever is the best will get that crown thing lol
    10·2 answers
  • LensForAll is a company that sells affordable contact lenses on its website. The CEO of the company realizes that an app must be
    9·1 answer
  • An ip address contains four sets of numbers what are they called
    11·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    12·2 answers
  • java Two smallest numbers Write a program that reads a list of integers, and outputs the two smallest integers in the list, in a
    6·1 answer
  • Please help me with this
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!