Question

Create a new Java class called: House public class House Remember that Java is case-sensitive. This means that the class name Diamond should start with a capital letter, and then the rest of the letters should be all lower-case. It would work if you were to use any combination of upper and lower-case letters, but that idea does not follow the assignment instructions. Write a Java application program that prints, the following house drawing to the screen: The house is printed by using several Java System.out.printin statements-one per line. Each print statement should print some spaces, and some asterisks. This program does not need to get any input from the user, therefore the user will not be required to type anything into the program while the program is executing. Likewise, you will not need the import statement at the top of the program since no keyboard input is required.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Screenshot of program:

public class House public static void main (String[] args) System.out.print(It System.out.print (t ); System.out.print (t

Program: //Spacing might differ due to pasting the code.

public class Main

{

public static void main(String[] args) {

System.out.print("\t *\n");

System.out.print("\t * *\n");

System.out.print("\t * *\n");

System.out.print("\t * *\n");

System.out.print("\t * *\n");

System.out.print("\t ***********\n");

}

}

Output:

Add a comment
Know the answer?
Add Answer to:
Create a new Java class called: House public class House Remember that Java is case-sensitive. This...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Java coding. Create a class called Printer and a class called Job that will simulate a...

    Java coding. Create a class called Printer and a class called Job that will simulate a computer printer. The printer should store a queue of Job objects until they are printed. Each Job should consist of a title and the number of pages the job contains. The printer should also store the number of jobs it can print per minute. The class should include methods to add jobs and print jobs. The method that prints a job should return the...

  • Java program Program: Grade Stats In this program you will create a utility to calculate and...

    Java program Program: Grade Stats In this program you will create a utility to calculate and display various statistics about the grades of a class. In particular, you will read a CSV file (comma separated value) that stores the grades for a class, and then print out various statistics, either for the whole class, individual assignments, or individual students Things you will learn Robustly parsing simple text files Defining your own objects and using them in a program Handling multiple...

  • create a Java class ShiftCipher The program ShiftCipher should take two inputs from the terminal. The...

    create a Java class ShiftCipher The program ShiftCipher should take two inputs from the terminal. The first should be a string of any length which contains any type of symbol (the plaintext). The second will be a shift value which should be between 0 and 25 inclusive (though you may design your program to be resilient to shifts beyond this value). The program should print the cipher text, in which each of the alphabetic characters in the string is shifted...

  • Java I: Create a Java program that will accept the price of an item and the...

    Java I: Create a Java program that will accept the price of an item and the quantity being purchased of that item. After accepting the input, calculate the amount of the purchase (based on the price and quantity), calculate the sales tax on the purchase, then output the product price, quantity, subtotal, sales tax, and the total sale based on the output format shown below. Structure your file name and class name on the following pattern: The first three letters...

  • Write a program that reads a string from the keyboard and computes the two arrays of...

    Write a program that reads a string from the keyboard and computes the two arrays of integers upperCase, and lowerCase, each of size 26. The first one represents the frequency of upper case letters and the second one represents the frequency of lower case letters in the input string. After computing these arrays, the program prints the frequencies in the following format: The frequency of the letter A= The frequency of the letter B= Assume the input string contains only...

  • Hello Guys. I need help with this its in java In this project you will implement...

    Hello Guys. I need help with this its in java In this project you will implement a Java program that will print several shapes and patterns according to uses input. This program will allow the use to select the type (say, rectangle, triangle, or diamond), the size and the fill character for a shape. All operations will be performed based on the user input which will respond to a dynamic menu that will be presented. Specifically, the menu will guide...

  • Need Help....Java MyProgram.java: public class MyProgram { public static void main(String[] args) { } } House.java:...

    Need Help....Java MyProgram.java: public class MyProgram { public static void main(String[] args) { } } House.java: public class House { private String address; private double cost; private double interst; private int mortgageTime; private double monthPayment; } As you consider your life before you, one thing you may consider is buying a house in the future. In this assignment, you will explore concepts of this amazing opportunity and create a program that may be of benefit to you in the future!...

  • Create a java project and create Student class. This class should have the following attributes, name...

    Create a java project and create Student class. This class should have the following attributes, name : String age : int id : String gender : String gpa : double and toString() method that returns the Student's detail. Your project should contain a TestStudent class where you get the student's info from user , create student's objects and save them in an arralist. You should save at least 10 student objects in this arraylist using loop statement. Then iterate through...

  • Write a Java program which takes a string as a user input. Create 2 functions. The...

    Write a Java program which takes a string as a user input. Create 2 functions. The first function expects a string as argument and returns void. It converts all upper case characters to lower case and converts all lower case characters to upper case. It then prints out the converted string to a console. The second function also expects a string as argument and returns void. It will find first charactor that is repeated exactly 2 times in the string....

  • In this assignment you will create two Java programs: The first program will be a class...

    In this assignment you will create two Java programs: The first program will be a class that holds information (variables) about an object of your choice and provides the relevant behavior (methods) The second program will be the main program which will instantiate several objects using the class above, and will test all the functions (methods) of the class above. You cannot use any of the home assignments as your submitted assignment. Your programs must meet the following qualitative and...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT