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
Windows, Apple’s Mac OS, and Unix/Linux are just some of the most common what?
34kurt
Most common PC operating systems
7 0
3 years ago
Read 2 more answers
The class ________ is the portion of a class that is visible to the application's programmer.
Lady_Fox [76]

The correct option to this question is class interface.

The class interface is the portion of a class that is visible to the application’s programmer. Class interfaces mean implementation of public methods of the class. These class interfaces of the class are easily visible to the application’s program either the one who is developing the application program or the one who is reading the application’s code.

Class interface can be seen by the other classes as its public face. Class interfaces separate the class’s implementation and its interaction with other classes. That way the implementation of the class can be modified easily without being known by other classes. Basically, the programmer who is developing the program, all the portions of the programm is visible to that programmer.

For example, the class is written below:

class class-name

{

private members;

public method()

{

//method defination

}

}

when the class object is created, the code of the object to the programmer is visible.

<u>While the other options are incorrect:</u>

  • Form: the form is used to collect information from the user. It can be build using front-end development tools
  • Design: Design is a term used in computer or software engineering to make something from scratch or beginning. It can be  methodologies, standards, or techniques etc.
  • Control: Control is the mechanism or a term used in software development to control the program or execution of the program.

You can learn more about class interface at

brainly.com/question/13089781

#SPJ4

The complete question is found while searching over internet:

"

<em>The class ________ is the portion of a class that is visible to the application's programmer.</em>

  • <em>Interface</em>
  • <em>Form</em>
  • <em>Design</em>
  • <em>Control </em>

"

7 0
1 year ago
What stdio.h input function would be used to get input from the user by the keyboard? Write the code to obtain the voltage drop
torisob [31]

Answer:

scanf() function is used to get a input from keyboard.This function is in the stdio.h library.To use this function we must include the stdio.h library first in the code. Then only we can use the scanf() function in any code.printf() function is used to print anything .this function is from stdio.h library.

Code to read voltage drop across the register.

#include <stdio.h>

// main function

int main(void) {

// variable

double vr1;

printf("Enter voltage drop:");

// read  voltage drop from user

scanf("%lf",&vr1);

// print voltage drop

printf("voltage drop is:%0.2lf",vr1);

return 0;

}

Output:

Enter voltage drop:200.4                                                                                                  

voltage drop is:200.40

8 0
3 years ago
Write a program that would determine the day number in a non-leap year. For example, in a non-leap year, the day number for Dec
SOVA2 [1]

Answer:

In Python:

months = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]

daymonths = [31,28,31,30,31,30,31,31,30,31,30,31]

day = int(input("Day: "))

month = input("Month: ")

ind = months.index(month)

   

numday = 0

for i in range(ind):

   numday+=daymonths[i]

numday+=day

print(numday)    

Explanation:

This initializes the months to a list

months = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]

This initializes the corresponding days of each month to a list

daymonths = [31,28,31,30,31,30,31,31,30,31,30,31]

This gets the day from the user

day = int(input("Day: "))

This gets the month from the user

month = input("Month: ")

This gets the index of the month entered by the user

ind = months.index(month)

This initializes the sum of days to 0

numday = 0

This adds up the days of the months before the month entered by the user

<em>for i in range(ind):</em>

<em>    numday+=daymonths[i]</em>

This adds the day number to the sum of the months

numday+=day

This prints  the required number of days

print(numday)    

<em>Note that: Error checking is not done in this program</em>

7 0
3 years ago
What is a client benefit of partnering with Accenture's Intelligent Platform Services<br> (IPS)?
charle [14.2K]
It’s a bot Bc when you do stuff you can believ it
8 0
2 years ago
Other questions:
  • Unlike a virtual image, a real image
    7·1 answer
  • When IPv4 addressing is manually configured on a web server, which property of the IPv4 configuration identifies the network and
    12·1 answer
  • A5.3 1012 kg satellite is 1,800 m from another satellite that has a mass of 3.5 x 108 kg. What is the gravitational
    6·1 answer
  • What does the following loop do?
    5·1 answer
  • How is a correction made to an Electronic health record?
    14·1 answer
  • I have all the points to level up to virtuoso, but it hasn't yet does anyone know when it will?
    9·1 answer
  • Match the definitions of different business communication to the type of document
    7·2 answers
  • Describe the main roles of the communication layer, the network-wide state-management layer, and the network-control application
    15·1 answer
  • search engines use software that combs the web to find webpages and add new data about them to the database. what is this softwa
    5·1 answer
  • What year did apple computer introduce the first ipod?.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!