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
Lady bird [3.3K]
3 years ago
7

In java Define a method printFeetInchShort, with int parameters numFeet and numInches, that prints using ' and " shorthand. Ex:

printFeetInchShort(5, 8) prints: 5' 8" Hint: Use \" to print a double quote.
import java.util.Scanner;

public class HeightPrinter {

/* Your solution goes here */

public static void main (String [] args) {
printFeetInchShort(5, 8);
System.out.println("");

return;
Computers and Technology
1 answer:
USPshnik [31]3 years ago
3 0

Answer:

   public static void printFeetInchShort(int numFeet, int numInches) {

       System.out.println(numFeet+"\'"+ numInches+"\"");

   }

Explanation:

To format the output properly, make use of the excape sequences (\' and \'') with string concatenation.

The complete code is given below:

public class StringLength {

   public static void printFeetInchShort(int numFeet, int numInches) {

       System.out.println(numFeet+"\'"+ numInches+"\"");

   }

   public static void main(String[] args) {

       printFeetInchShort(5, 8);

       System.out.println("");

   }

}

You might be interested in
I need help with Python. The first image is the code and the 2nd is the output.
Gekata [30.6K]
The issue arises because the string you are trying to print is not a string, rather a float value. Item1, item2 and item3 are strong values (if you type some alphabets in it and not just numbers), but itemonecost, itemtwocost, and itemthreecost are explicitly type casted to float. In line 22, 23, and 24 you’re trying to print a float, by adding it with the string. One cannot add numbers to string. Rather you can type cast the itemcost to string while printing.

Add str(itemonecost) instead of itemonecost in print statement. Do this for other float variables too.

However do note that there are multiple ways to correct this issue, and I’ve just pointed one out.
4 0
3 years ago
Stages of reverse engineering
ivann1987 [24]

Answer:

Capture Data, Refine the Model, and then Manufacture it.

Explanation:

5 0
2 years ago
What special enterprise VPN supported by Cisco devices creates VPN tunnels between branch locations as needed rather than requir
castortr0y [4]

Answer:

Dynamic Multipoint VPN

Explanation:

4 0
2 years ago
Help meeeeeeeeeeeeeee please​
bija089 [108]

Answer:

Explanation:My explanation is above my comment :)

3 0
3 years ago
After purchasing new computers for her​ department, a manager is now comparing the performance of the new computers to the compu
AlladinOne [14]

Answer:

evaluation of decision effectiveness

Explanation:

Based on the information provided within the question it can be said that in this scenario she is in the stage of evaluation of decision effectiveness. This is the stage after the decision has been made in which the individual begins to analyze the decision and determine whether the decision was as effective as originally anticipated , and whether or not it was the correct decision.

8 0
3 years ago
Other questions:
  • What type of software translates a programmer’s statements to binary form?
    10·1 answer
  • In project integration management, project ______ and _______ are intertwined and inseparable activities
    14·1 answer
  • A difference between crt monitors and flat-panel displays is that most flat-panel displays use digital signals to display images
    8·1 answer
  • HELP PLEASE!!! I do online school, someone is in another state wanting to help me. No not do my work for me but view what I view
    6·1 answer
  • Help me find the difference between these logos
    10·2 answers
  • Zoom meeting ID:987 6858 5587 Password:196133
    10·2 answers
  • What will the following code display? int numbers[4] = { 99, 87 }; cout << numbers[3] << endl; a. 87 b.0 d. 34. What
    12·1 answer
  • A slide titled Alexander Graham Bell. There are 6 bulleted entries on the slide, and there is a lot of text on the slide. There
    11·2 answers
  • when inserting a bibliography one choose from multiple ______ of bibliographies.[insert Bibliography]
    12·1 answer
  • Write steps: To open an old documents​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!