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
tensa zangetsu [6.8K]
3 years ago
5

Write a program that can print a banner with rotated letters, such that they can be read from top to bottom. Specifically, each

letter in the message should be printed using multiple lines composed of * symbols. The code to print each letter should go into a separate method just for that letter (no parameters, no return value). Don’t worry, you don’t need to make 26 different methods, just 8: the seven letters in the message "Hello World" (D, E, H, L, O, R, and W) and a space. In your main method, you should ask the user to type a message. Then, loop through each character in the message and, for each character, if you have a corresponding method, call the method to print out the letter to the screen, ignoring any other characters. To help get you started, here is an example method for the letter D:
Computers and Technology
1 answer:
My name is Ann [436]3 years ago
4 0

Answer:

package Lab6Problema;

import java.util.Scanner;

public class Lab6Problema{

public static void H() // prints H

{

System.out.println();

System.out.println("** **");

System.out.println("** **");

System.out.println("******");

System.out.println("** **");

System.out.println("** **");

}

 

public static void E()//prints E

{

System.out.println();

System.out.println("******");

System.out.println("** ");

System.out.println("******");

System.out.println("** ");

System.out.println("******");

}

 

public static void L()//prints L

{

System.out.println();

System.out.println("* ");

System.out.println("* ");

System.out.println("* ");

System.out.println("* ");

System.out.println("******");

}

 

public static void O()//prints O

{

System.out.println();

System.out.println("******");

System.out.println("* *");

System.out.println("* *");

System.out.println("* *");

System.out.println("******");

}

 

public static void W()//prints W

{

System.out.println();

System.out.println("* *");

System.out.println("* *");

System.out.println("* ** *");

System.out.println("* ** *");

System.out.println("** **");

}

 

public static void R()//prints R

{

System.out.println();

System.out.println("***** ");

System.out.println("** **");

System.out.println("***** ");

System.out.println("** **");

System.out.println("** **");

}

 

public static void D()//prints D

{

System.out.println();

System.out.println("**** ");

System.out.println("* * ");

System.out.println("* *");

System.out.println("** * ");

System.out.println("**** ");

}

public static void blank() //prints blank space

{

System.out.println();

System.out.println();

System.out.println();

}

public static void main(String[] args) {

//just enter "Hello World" as input as specified

System.out.println("Enter a Message");

Scanner scan=new Scanner(System.in);

String myMessage=scan.nextLine(); // read msg using scanner

int numOfCharacters=myMessage.length();// calculate message lenth

for(int i=0;i<numOfCharacters;i++) // loop through each chracter in msg

{

// gets character at position i, and switch accordingly

switch(myMessage.charAt(i))

{

// if character is 'H' or 'h', call method H(). Similarly for other

// Hecharacters in message.

case 'H':

case 'h':H();break;

case 'E':

case 'e':E();break;

case 'L':

case 'l':L();break;

case 'O':

case 'o':O();break;

case 'W':

case 'w':W();break;

case 'R':

case 'r':R();break;

case 'D':

case 'd':D();break;

case ' ':blank();break;

}

}

}

}

Explanation:

You might be interested in
A cycle merchant allows 15% discount on the marked price of a bicycle and still he makes a profit
lions [1.4K]

Answer:

The program in Java is as follows:

public class Main{

public static void main(String[] args) {

 double discount_percent = 0.15;

 double discount_amount = 600;

 double profit = 0.20;

 double marked_price = discount_amount/discount_percent;

 double cost_price = marked_price/(1 + profit);

 System.out.println("Marked Price: "+marked_price);

 System.out.println("Cost Price: "+cost_price);

}}

Explanation:

For explanation purpose, let

MP \to Marked Price

\%D \to Percentage discount

D \to Discounted amount

\%P \to Percentage Profit

C \to Cost Price

The marked price (i.e. selling price) is calculated discount using:

MP = \frac{D}{\%D}

The derived formula of the cost price from percentage profit and Marked Price is:

C = \frac{M}{1 + \%P * 100}

So, the explanation is as follows:

The next three lines declare and initialize the given parameters

<em>  double discount_percent = 0.15;</em>

<em>  double discount_amount = 600;</em>

<em>  double profit = 0.20;</em>

Calculate marked price

 double marked_price = discount_amount/discount_percent;

Calculate cost price

 double cost_price = marked_price/(1 + profit);

Print marked price

 System.out.println("Marked Price: "+marked_price);

Print Cost price

 System.out.println("Cost Price: "+cost_price);

3 0
2 years ago
A _______ attack uses software to try thousands of common words sequentially in an attempt to gain unauthorized access to a user
sergeinik [125]
<h2>A <u>Rogue attack</u> utilizes software just to attempt hundreds of frequent phrases in a row.</h2>

  • Rogue access equipment would be any WLAN radio channel that isn't even authorized to communicate or join the corporate connection.
  • Whenever they have been misconfigured as well as set up without authentication, it creates a new security vulnerability potentially gaining simple access to a private network.

Thus the response above is correct.

Learn more about software attacks here:

brainly.com/question/25407509

7 0
2 years ago
Read 2 more answers
: Each individual data items of record is called a
musickatia [10]
Each individual data items of record is called field (letter A).
The client may communicate with Proxy server to use a protocol to proxy the communication between the client and the DBMS. Proxy servers lets you hide your real Ip address and replaces it with a new IP obtained from proxy server sites.

6 0
3 years ago
Plllzzzzzzzzzzzzzz annnssswweeweerrr...
s2008m [1.1K]

Answer:

An example of effective communication is when the person who you are talking to listens actively and absorbs your point and understands it.

Explanation:

Hope this helps!!

3 0
3 years ago
1. What does a network allow computers to share?
Veronika [31]

Answer:

1. B 2. D

Explanation:

If computers share processing power, it is just a larger computer.

8 0
3 years ago
Other questions:
  • Pendant Publishing edits multi-volume manuscripts for many authors. For each volume, they want a label that contains the author'
    14·1 answer
  • A computer has a word length of 8 bits (including sign). if 2’s complement is used to represent negative numbers, what range of
    5·1 answer
  • Write a function named get_my_age that returns your age as an int (this is YOUR age, so if you were 21 you would return the numb
    11·1 answer
  • With the ease of the Internet, it is not uncommon for individuals to copy skills from resume templates to make themselves look m
    9·1 answer
  • How do I learn coding? Python
    5·2 answers
  • Software for creating animations
    15·2 answers
  • What is the build in libary function to compare two strings?​
    15·1 answer
  • If you misspell a word in your Java program it may be true that I. the program will not compile II. the program may compile, but
    6·1 answer
  • Why is computer economics important?​
    10·1 answer
  • How to create create a database in mysql using clv files
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!