1. Engineering
  2. Computer Science
  3. write statements that output variable numhouses as follows end with...

Question: write statements that output variable numhouses as follows end with...

Question details

Write statements that output variable numHouses as follows. End with a newline.

Ex: If numHouses is 10, the program should output:

Number of houses: 10
    1 import java.utit.scanner 2 3 public class VariableOutput 1 4public static void main (String args) t int numHouses; Scanner scnr-new Scanner(System.in); numHouses scnr.nextIntO; Your solution goes here*/ numHouses -10;/7 Program will be tested with values: 10, 33 System.out.printlnCNumber of houses:+humHouses); 10 12 13 14 15 3 16 2 Check Try again System.out.print0 and System.out.println can be used to output both string literals and a variables value. Text in double quotes is known as a string literal, whereas there are no quotes around the variables name Testing with input 10 Output is nearly correct; but whitespace differs. See highlights below. Special character legend Your output Expected output Number of houses: 10 Number of houses: 10
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution