answer.
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
Mrrafil [7]
2 years ago
12

2.4: Star Pattern Write a program that displays the following pattern: * *** ***** ******* ***** *** * Output. Seven lines of ou

tput as follows: The first consists of 3 spaces followed by a star. The second line consists of 2 spaces followed by a 3 stars. The third consists of one space followed by 5 stars, and the fourth consists just of 7 stars. The fifth line is identical to third, th sixth to the second and the seventh to the first. CLASS NAMES. Your program class should be called StarPattern
Computers and Technology
1 answer:
adelina 88 [10]2 years ago
5 0

Answer:

// here is code in java.

public class NAMES

{

// main method

public static void main(String[] args)

{

int n=4;

// print the upper half

for(int a=1;a<=n;a++)

{

for(int b=1;b<=n-a;b++)

{

// print the spaces

System.out.print(" ");

}

// print the * of upper half

for(int x=1;x<=a*2-1;x++)

{

// print the *

System.out.print("*");

}

// print newline

System.out.println();

}

// print the lower half

for(int y=n-1;y>0;y--)

{

for(int z=1;z<=n-y;z++)

{

// print the spaces

System.out.print(" ");

}

for(int m=1;m<=y*2-1;m++)

{

// print the *

System.out.print("*");

}

// print newline

System.out.println();

}

}

}

Explanation:

Declare a variable "n" and initialize it with 4. First print the spaces (" ") of the upper half with the help of nested for loop.Then print the "*" of the upper half with for loop. Similarly print the lower half in revers order. This will print the required shape.

Output:

  *

 ***

*****

*******

*****

 ***

  *

You might be interested in
Which type of word processing programs enables us to include illustrations within the program?
bonufazy [111]

Answer:

C.  full featured

Explanation:

You need to make use of the full-featured version of the word processing programs to use the illustrations that are part of the program. And simple versions might not have that. By fully featured it means you need to have the license included or else you will be able to use it for a few days or a maximum of 3 months, and that is certainly not a good idea.

5 0
1 year ago
A computer’s memory is composed of 8K words of 32 bits each. How many bits are required for memory addressing if the smallest ad
victus00 [196]

Answer:

The minimum number of bits necessary to address 8K words is 13.

Explanation:

You have the number of words to address that is 8000 words, a word is the smallest addressable memory unit.  

8000 words can be addressed with 2^{n}  units. Now you have to find the value of n that approximates to the number of words.  

2^2=4\\2^4=16\\2^7=128\\2^{10}=1024\\2^{12}=4096\\2^{13}=8192

So you can see that 13 bits are needed to address 8K words.

7 0
1 year ago
Select the examples that best demonstrate likely employers for Journalism and Broadcasting workers. Check all that apply.
Delicious77 [7]

Answer:

a radio station

a newspaper

a television network

Explanation:

4 0
1 year ago
Read 2 more answers
Which Artificial Intelligence (AI) term is used to describe extracting information from unstructured text using algorithms?
Alla [95]

Answer:

The most basic and useful technique in NLP is extracting the entities in the text. It highlights the fundamental concepts and references in the text. Named entity recognition (NER) identifies entities such as people, locations, organizations, dates, etc. from the text.

5 0
2 years ago
Dan is a Civil Engineer for a company that builds nuclear power plants throughout the world. Which best describes the places he
Yanka [14]
IN a laboratory... C 
4 0
2 years ago
Read 2 more answers
Other questions:
  • What is one effective way for employees to keep their skillsets current?
    8·2 answers
  • Suggest two other subtasks that may be performed in a dice game?
    15·2 answers
  • Select the correct answer. James is a sales analyst of a departmental store chain. He checked the sale records for the past 12 m
    6·2 answers
  • Delete Prussia from country_capital. Sample output with input: 'Spain:Madrid,Togo:Lome,Prussia: Konigsberg' Prussia deleted? Yes
    13·1 answer
  • Given an alphabet, print all the alphabets up to and including the given alphabet.
    15·2 answers
  • Describe the basic features of the relational data model and discuss their importance to the end user and the designer. Describe
    9·1 answer
  • SHOW ALL YOUR WORK. REMEMBER THAT PROGRAM SEGMENTS ARE TO BE WRITTEN IN JAVA. Assume that the classes listed in the Java Quick R
    9·1 answer
  • Read the four detective reports and the combined affidavit and warrant for the M57 Patents case. Write a one- to two-page paper
    5·1 answer
  • Suggest how the following requirements might be rewritten in a quantitative way. You may use any metrics you like to express the
    7·1 answer
  • Which of the following could NOT be represented by a boolean variable?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!