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
Dominik [7]
2 years ago
10

Write a second convertToInches() with two double parameters, numFeet and numInches, that returns the total number of inches. Ex:

convertToInches(4.0, 6.0) returns 54.0 (from 4.0 * 12 + 6.0).FOR JAVA PLEASEimport java.util.Scanner;public class FunctionOverloadToInches {public static double convertToInches(double numFeet) {return numFeet * 12.0;}/* Your solution goes here */public static void main (String [] args) {double totInches = 0.0;totInches = convertToInches(4.0, 6.0);System.out.println("4.0, 6.0 yields " + totInches);totInches = convertToInches(5.9);System.out.println("5.9 yields " + totInches);return;}}
Computers and Technology
1 answer:
mixer [17]2 years ago
5 0

Answer:

   public static double convertToInches(double numFeet, double numInches){

       return (numFeet*12)+numInches;

   }

Explanation:

This technique of having more than one method/function having the same name but with different parameter list is called method overloading. When the method is called, the compiler differentiates between them by the supplied parameters. The complete program is given below

public class FunctionOverloadToInches {

   public static void main(String[] args) {

       double totInches = 0.0;

       totInches = convertToInches(4.0, 6.0);

       System.out.println("4.0, 6.0 yields " + totInches);

       totInches = convertToInches(5.9);

       System.out.println("5.9 yields " + totInches);

       return;

   }

   public static double convertToInches(double numFeet)

       {

           return numFeet * 12.0;

       }

       /* Your solution goes here */

   public static double convertToInches(double numFeet, double numInches){

       return (numFeet*12)+numInches;

   }

}

You might be interested in
Computer system with a 32-bit logical address and 4k-byte page size. assume that each entry of a page table consists of 4bytes.
Annette [7]

The number of bits in the physical address is 26 bits. The number of entries in a page table is \mathbf{2^{20}} entries. The size of the page table in a one-level paging scheme is 4MB.

<h3>
What is paging in Operating System?</h3>

Paging is a storage method used in operating systems to recover activities as pages from secondary storage and place them in primary memory. The basic purpose of pagination is to separate each procedure into pages.

We are given the following parameters:

  • 32-bit logical address
  • Page size = 4 KB = \mathbf{2^{12} \ bytes }
  • Size of each Page table entry = 4 bytes

Suppose the system supports physical memory size = 64 MB = \mathbf{2^{26} \ bytes}

Thus, the number of bits in the physical address is computed as:

= \mathbf{log_2 \{Physical-memory-size\}}

=\mathbf{log_2(2^{26})}}

= 26 bits

The number of entries in a page table = logical address space size/page size

The number of entries in a page table \mathbf{= \dfrac{2^{32}}{2^{12}}}

\mathbf{=2^{20}} entries

In a one-level paging scheme, the size of the table is:

= entire no. of page entries × page table size

= \mathbf{2^{20}\times 4 \ bytes}

= 4 MB

b.

suppose that this system supports up to 2^30 bytes of physical memory.

  • The size of the page table will be the same as 4 MB due to the fact that the number of entries, as well as, the page table entry size is the same.

Since the size of the page table surpasses that of a single page. A page cannot include a whole page table. Therefore, the page table must be broken into parts to fit onto numerous pages, and an additional level of the page table is required to access this page table.

  • This is called the Multi-Level Paging system.

Therefore, we can conclude that the number of bits in the physical address is 26 bits, the number of entries in a page table is \mathbf{2^{20}} entries, and the size of the page table in a one-level paging scheme is 4MB.

Learn more about Paging in Operating System here:

brainly.com/question/17004314

#SPJ1

4 0
1 year ago
Java: which expression is evaluated first
nignag [31]

Answer:c ll d  

Explanation:

cus they are inside ()--parantheses

5 0
2 years ago
You want to securely erase data from your hard drive what can you use to do this and what is the process called
tankabanditka [31]
You could Factory Reset a computer or you could smash it with  a hammer
7 0
2 years ago
Read 2 more answers
A user logs in to a virtual world and creates an animated character representing themselves, which they then use to move through
Romashka [77]

A type of animated character that represents a user in the virtual world, which is used to move throughout the world and interact with other characters and objects is called an <u>avatar</u>.

<h3>What is an avatar?</h3>

An avatar can be defined as a type of animated character that is designed and developed by a software developer to represent a user or player in the virtual world, which is used to move throughout the world and interact with other characters and objects.

In gaming technology and software development, an avatar is typically used to denote a user's (player's) character in the gaming world, virtual world or computer-simulated environment, either in two-dimensional (2D) or three-dimensional (3D).

Read more on avatar here: brainly.com/question/26479902

4 0
2 years ago
Read 2 more answers
After installing the processor, if the system begins the boot process and suddenly turns off before completing the boot, the pro
NikAS [45]

Answer:

A. True

Explanation:

Be sure your processor is receiving sufficient cooling by verifying if there is a heatsink on it. If there is, make sure that it's inserted fully into cpu_fan port on the motherboard. If the boot process still turns off, you may have a defective processor or replace the motherboard.

8 0
3 years ago
Other questions:
  • Effective feedback should focus on the behavior, not the person.<br><br> True<br> False
    9·2 answers
  • Howard is leading a project to commission a new information system that will be used by a federal government agency. He is worki
    7·1 answer
  • Which option should you select to ignore all tracked changes in a document? To ignore all tracked changes in a document, you sho
    15·2 answers
  • Convert each of the following base 10 &amp; base 2 numbers in signed magnitude, one’s complement and two’s complement. Each of t
    8·1 answer
  • What is the full from of CPU?​
    5·2 answers
  • 1. I write about my travel experiences on my own personal ____?
    12·1 answer
  • True or False? Popular sites are always mean accurate.
    14·2 answers
  • Answer all of the questions,
    7·1 answer
  • If your cell phone rings while you are driving and you do not have a hands-free device you should
    9·1 answer
  • Which is NOT true?<br> 9 + 4 = 17 - 4<br> 8 + 7 = 14 + 3<br> 11 = 19 - 8<br> 5 + 8 = 20 - 7
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!