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
bulgar [2K]
3 years ago
15

Write code statements that prompt for and read a double value from the user, and then print the result of raising that value to

the fourth power. Output the results to three decimal places.
Computers and Technology
1 answer:
andriy [413]3 years ago
5 0

Answer:

Following are the code in Java Language:

Scanner sc = new Scanner(System.in); // create a instance of scanner class

DecimalFormat frmt = new DecimalFormat("0.###"); // create a instance of                // DecimalFormat class

System.out.println ("Enter the value: ");

double number = scan.nextDouble(); // Read the value by thje user

System.out.println (fmmt.format(Math.pow(number, 4))); // display the value

Explanation:

Following are the description of the code

  • Create an instance scanner class i.e "sc".
  • Create an instance of DecimalFormat class i.e "frmt".
  • Read the value by the user in the "number" variable of type double by using the nextDouble()method.
  • Finally, display the value by using System.out.println method. In this, we call the method format. The Math.pow() function is used to calculating the power up to the fourth value.

You might be interested in
You are troubleshooting a cpu and have already cut power, disconnected the power cable, opened the case, and put on your antista
Nonamiya [84]
If you're aware that it is the CPU causing this problem, then you want to aim at the CPU fan, it is usually always on top of the CPU, once it is removed, take some time to know what socket you motherboard has, there are many types of sockets for both Intel and AMD  PC's the most common socket's for Intel is LGA1150 and for AMD it is either AM3/AM3+
3 0
3 years ago
What is the exact volume of the cone​
tresset_1 [31]

Answer: You're going to have to put parameters.

Explanation: Anyways, the formula for solving a cone is V=\pi r^{2} \frac{h}{3} . Where r is the radius of the base of the cone and h is the height from the center of the base to the tip of the cone. You can google "cone volume formula" and google will show a cone volume calculator and you can type in the parameters.

7 0
3 years ago
Write a class named Book that has fields to hold the following data: Title Author Year published ISBN number In the Book class,
Hatshy [7]

Answer:

public class Book {

   private String title;

   private String author;

   private int yearPublished;

   private long ISBN;

   //The Constructor for all the feilds

   public Book(String title, String author, int yearPublished, long ISBN) {

       this.title = title;

       this.author = author;

       this.yearPublished = yearPublished;

       this.ISBN = ISBN;

   }

   //Mutator methods (set) to Set values of all the fields

   public void setTitle(String title) {

       this.title = title;

   }

   public void setAuthor(String author) {

       this.author = author;

   }

   public void setYearPublished(int yearPublished) {

       this.yearPublished = yearPublished;

   }

   public void setISBN(long ISBN) {

       this.ISBN = ISBN;

   }

   //Accessor Methods (getters) for all the feilds

   public String getTitle() {

       return title;

   }

   public String getAuthor() {

       return author;

   }

   public int getYearPublished() {

       return yearPublished;

   }

   public long getISBN() {

       return ISBN;

   }

}

// The Demo Class creating three instances of this class

class BookDemo{

   public static void main(String[] args) {

       Book bookOne = new Book("The Lion and the Princess","David A.",2000,12334556);

       Book bookTwo = new Book ("Me and You", "Jane G.", 2001, 4567342);

       Book bookThree = new Book("together forever", "Baneely H.",2019,34666);

   }

}

Explanation:

  • Please pay attention to the comments provided in the solution
  • Using Java Programming Language
  • The class Book is created with the required fields
  • The constructor is created to initialize the values of the fields
  • Getter methods are created
  • Setter Methods are Created
  • A demo Class BookDemo that creates three objects of the Book class is the created (This can be in the same file as the Book class but cannot start with the keyword public or in a separate file with the keyword public class BookDemo)
  • Inside BookDemo class, three instances of the Book class are created and initialized.
3 0
3 years ago
Which of the following is not true about preprocessor directives
REY [17]

Answer:

A.

They begin with a harsh symbol.

Explanation:

5 0
3 years ago
What is the purpose of anti-bullying laws
nasty-shy [4]
The purpose of anti-bullying laws is so that people aren’t getting bullied because when someone gets bullied it could cause them to become depressed and not happy on who they are
6 0
3 years ago
Read 2 more answers
Other questions:
  • 1. Think about the various ways in which you have seen hackers portrayed in popular media over the past few years. Are they hero
    11·1 answer
  • In a doubly linked list, every nodecontains the address of the next node and the previousnode except for the ____ node.
    8·1 answer
  • You can install several printers on your machine, but at least one must be the _______ printer.
    6·1 answer
  • Angela recently purchased a new Android smartphone. While purchasing the phone, Angela was told that she would need to set up a
    5·1 answer
  • Technician A says that almost every part of a vehicle is somehow powered by or controlled by an electrical or electronic system.
    9·2 answers
  • what are the benefits of VolP? select all that apply. A:cheaper printings B:clearer calls C: faster download D: increased effici
    11·2 answers
  • Explain how principles of computer programming are applied in different languages to produce
    5·1 answer
  • Which file types have exe and png as their extensions?
    10·1 answer
  • Keith would like to compare data he has collected from research. The data includes the electrical output
    13·1 answer
  • What are the dominant InfoSec-related credentials used to document knowledge and/or experience?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!