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
puteri [66]
4 years ago
14

Using the NumberFormat class, write code that will create a double called cv, assign it a value of 18.7713, and then convert it

to a String rounded off to the nearest hundredth. Assure that at least 1 decimal place is printed. Print the String.
Computers and Technology
1 answer:
spayn [35]4 years ago
3 0

Answer:

// Program to convert rounded decimal to string

// This program segment is written in Java programming language

// Comments are used for explanatory purpose

// Program starts here

import java.text.D ecimalFormat;

public class RoundNumbers

{

public static void main(String[] args) {

// Declare number and assign value to it

double cv = 18.7713;

// Call decimalformat method

DecimalFormat commaType = new DecimalFormat("#,###.###");

//Convert cv to string

String myPi = commaFormat.format(cv);

// Print result

System.out.println(commaType.format(cv));

}

}

// End of Program

You might be interested in
Each row in a database is a set of unique information called a(n)
blondinia [14]

A row, which is also called a tuple.

4 0
3 years ago
Read 2 more answers
what happens when you double-click on a file with an extension that represents an executable program?
Vlada [557]

Answer:

it will execute the file

Explanation:

3 0
4 years ago
The home keys on the numeric keypad are?
Eva8 [605]
4, 5 , 6 , and plus key
456+
5 0
3 years ago
Read 2 more answers
java Consider the following problem statement. A cookie recipe calls for the following ingredients: 1.5 cups of sugar 1 cup of b
Veronika [31]

Answer:

Explanation:

The following code is written in Java. It creates a program that asks the user how many cookies they want to make. Then it adjusts the original recipe based on the ratio of the original amount of cookies it makes to the amount the user wants. Finally, passing the output of the new adjusted recipe to the user. Due to technical difficulties, I have added the code as a txt file attached below.

4 0
3 years ago
This is gonna be very long but I have no idea what to do, I'm confused.
kaheart [24]

for such experiment, you do it with care and to acquire and determine to put experience in it

Explanation:

because without you been or using experience the experiment will not correct

8 0
3 years ago
Other questions:
  • Which statement is true
    12·1 answer
  • To open the format cells dialog box with the alignment sheet active, tap or click the alignment settings ____.
    8·1 answer
  • If userA wants to send a secure message to userB using an asymmetric cryptographic algorithm, which key does userB use to decryp
    11·1 answer
  • Angela and Jose saved files to a USB drive as well as on their computers' hard drive. A Angela and Jose saved files to a USB dri
    11·1 answer
  • Help please brainliest
    8·1 answer
  • ICT 10
    8·1 answer
  • Although it is not a term Excel uses, how do most people think of Excel?
    13·1 answer
  • What is one benefit of Powerpoint Online?
    14·2 answers
  • Trade Periodicals are usually highly scholarly resources<br> True<br><br> False
    5·1 answer
  • What are the two broad categories that individual definitional techniques fall under? Check all that apply. Demonstrative defini
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!