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
Georgia [21]
3 years ago
14

Create an application named Percentages whose main() method holds two double variables. Assign values to the variables. Pass bot

h variables to a method named computePercent() that displays the two values and the value of the first number as a percentage of the second one. For example, if the numbers are 2.0 and 5.0, the method should display a statement similar to "2.0 is 40 percent of 5.0." Then call the method a second time, passing the values in reverse order.
Computers and Technology
1 answer:
lbvjy [14]3 years ago
8 0

Answer:

The codes below implement the problem statements

Explanation:

public class Percentages {

public static void computePercent (int a,int b)

{

System.out.println(a+" is "+(a*100/b)+"% of "+b);    

}

 

public static void main(String []args)

{

int a=2;

int b=5;

computePercent(a,b);

computePercent(b,a);

}

}

<u> </u>

<u>Part(b) </u>

import java.util.*;

public class Percentages {

public static void computePercent (int a,int b)

{

System.out.println(a+" is "+(a*100/b)+"% of "+b);

}

 

public static void main(String []args)

{

Scanner s= new Scanner(System.in);

int a=s.nextInt();

int b=s.nextInt();

computePercent(a,b);

computePercent(b,a);

}

}

You might be interested in
A perfect binary tree is a complete binary tree with all levels fully filled. Add a method in the BST class to return true if th
algol [13]

Answer:

class BST {

static class Node

{

int val;

Node left, right;

}

static boolean checkPerfectBT(Node node, int h, int d)

{

if (node == null)

return true;

 

if (node.left == null && node.right == null)

{

if(h==d+1)

return true;

else

return false;

}

 

if (node.left == null || node.right== null)

return false;

 

return checkPerfectBT(node.left, h, d+1) && checkPerfectBT(node.right, h, d+1);

}

static int height(Node node)

{

int dep = 0;

while (node != null)

{

node = node.right;

dep=dep+1;

}

return dep;

}

static boolean isPerfectBT(Node node)

{

int h = height(node);

return checkPerfectBT(node, h, 0);

}

 

static Node addNode(int x)

{

Node node = new Node();

node.val= x;

node.right = null;

node.left = null;

return node;

}

public static void main(String args[])

{

int i,j,k;

Node node= null;

node = addNode(34);

node.left = addNode(2);

node.right = addNode(322);

 

node.left.left = addNode(21);

node.left.right = addNode(23);

node.right.left = addNode(37);

node.right.right = addNode(54);

 

if (isPerfectBT(node) == true)

System.out.println("This is a Perfect Binary tree");

else

System.out.println("This is Not a perfect Binary Tree");

}

}

Explanation:

  • Calculate the depth of BST by using a while loop until it reaches a null value.
  • In the addNode method, make an object of Node class.
  • In the main method, pass the values to addNode method.
  • Finally display the relevant message to show if it's Perfect or not.
6 0
3 years ago
Omar sends a PDF file to his teacher. He then prepares another copy of the presentation that includes only the slides he wants t
maria [59]

Answer:

D. Custom Slide Show

Explanation:

Correct on edg

7 0
3 years ago
What are some of the current trends in fashion?
jonny [76]

Answer:

1. pocket sized

2. muted

3. children

Full Paragraph :

For women, pocket sized tote bags and high-heeled sandals are popular now. For men, muted colors are the new trend. Bomber jackets and prints are also a fad among children.

Yeah that's basically the new trends in fashion. =v=  

5 0
3 years ago
A user is having a difficult time printing certain types of documents to her laser printer. When she sends complex, mult-page, m
katen-ka-za [31]

Answer:

Add RAM to the printer

Explanation:

Adding RAM to the printers gives the following advantages:

  • printer prints the documents faster with reduced print time.
  • printer prints complex multi page, multi-color documents especially PDF files.
  • Print server sends the job according to the capacity of the printer so when the RAM is added the print server can send more jobs and the printing process becomes faster and printer will not refuse to print large documents. As a result printer can accept more print jobs.
  • It is also beneficial when the documents or files to be printed are of high resolution or are heavy files.
5 0
3 years ago
The P in SOAP stands for Persuasion. <br> a. True<br> b. False
fredd [130]
The answer is false.
  P in soap stands for purpose. SOAPS stands for Subject(what is being discussed), Occasion(what is the context of events), Audience(to whom the message is directed), Purpose(what is the recommended action for the reader) and the Speaker(what or who is the source).
4 0
2 years ago
Read 2 more answers
Other questions:
  • When you send an echo request message with the ping program, a successful attempt will return a(n) ______ message.
    8·1 answer
  • Write a statement to create a Google Guava Multimap instance which contains student ids as keys and the associated values are st
    12·1 answer
  • . Does Zuckerberg believe in the thought that “the endpoint is when you sell the
    15·1 answer
  • Remembering on which continent 5 different countries are located
    15·1 answer
  • Survey data can be collected with questionnaires. Which type of question has a limited number of preselected responses?
    12·1 answer
  • •Should other states wait to see if the high-speed rail system works well before starting their own plans for similar systems?
    15·1 answer
  • A good sentence about art
    9·1 answer
  • PLEASE HELP!
    12·1 answer
  • Why does my messenger say this person is unavailable on messenger.
    9·1 answer
  • _____ refers to the programs that a device can run.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!