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
emmasim [6.3K]
3 years ago
6

(Display characters) Write a method that prints characters using the following header: public static void printChars(char ch1, c

har ch2, int numberPerLine) This method prints the characters between ch1 and ch2 with the specified numbers per line. Write a test program that prints ten characters per line from 1 to Z. Characters are separated by exactly one space.
Computers and Technology
2 answers:
Butoxors [25]3 years ago
6 0

Answer:

Written in Java

public static void printChars(char ch1, char ch2, int numberPerLine){

        int i = 1;

        for(char A = ch1; A <= ch2; A++){

            if(i<=numberPerLine){

               System.out.print(A+" ");    

               i++;

            }

            else{

                System.out.println();

                i = 1;

            }

        }

    }

Explanation:

This line defines the method

public static void printChars(char ch1, char ch2, int numberPerLine){

This line initializes the number of print out per line to 1

        int i = 1;

The following is an iteration that prints from ch1 to ch2. Note that ch1 and ch2 are characters

        for(char A = ch1; A <= ch2; A++){

The following if condition (italicized) checks if the number of print outs is up to the required length.

If No, the character is printed

If yes, a new line is printed.

      <em>      if(i<=numberPerLine){</em>

<em>                System.out.print(A+" ");    </em>

<em>                i++;</em>

<em>             }</em>

<em>             else{</em>

<em>                 System.out.println();</em>

<em>                 i = 1;</em>

<em>             }</em>

        }

    }

See attachment for full program including test of ten characters in a line

Download txt
Juli2301 [7.4K]3 years ago
5 0

public class MyClass {

   public static void printChar(char ch1, char ch2, int numberPerLine){

       int i = 0;

       for (char c = ch1; c <= ch2; c++){

           while (i < numberPerLine){

               System.out.print(c + " ");

               i += 1;

           }

           System.out.println("");

           i = 0;

       }

   }

   public static void main(String args[]) {

     printChar('a', 'z', 10);

   }

}

So far, this works by printing letters. If you need me to modify the code, I will.

You might be interested in
Mrs. Sims polled her students about which social media app they use most. Which type of chart would best display this data?
Troyanec [42]
The best way to display this data is c. Pie chart
8 0
3 years ago
Read 2 more answers
State five fonction of THE operating system​
I am Lyosha [343]

Answer:

An operating system has three main functions: (1) manage the computer's resources, such as the central processing unit, memory, disk drives, and printers, (2) establish a user interface, and (3) execute and provide services for applications software.

Memory Management.

Processor Management.

Device Management.

File Management.

Security.

Control over system performance.

Job accounting.

Error detecting aids.

7 0
3 years ago
The term digital divide refers to "the gap between people with effective access to digital and information technology and those
skad [1K]

Answer:

Factors Influencing Unequal Internet Access:

1. Age: Children under 10 and adults over 60 do not enjoy the same level of access to the internet.  For children 10, their parents restrict their use of the internet.  Most adults over 60 lack the interest and competence to utilize access to the internet.

2. Sex: Men usually enjoy better access to the internet than women.  While men explore many sources of internet information, women usually restrict themselves to social media, which is usually their favorites, giving the high-level chatting that is involved in social media.

3. Nationality:  Access to the internet is not available equally in all the nations of the world.  In communist China, there are government-mandated restrictions placed on citizens.  In some sub-Saharan African countries, access to the internet is a luxury that many cannot afford and it is not easily available due to lack of basic internet infrastructure.

4. Education is another factor that influences access to the internet.  The level of education dictates whether somebody has access or not.  Many illiterate men and women who do not value the internet.  What you do not value, you do not use.  What you do not use is not accessible to you.

5. Income:  This is another important factor that influences access to the internet.  In some countries, the availability of high-speed network remains unaffordable to the majority of the population.  They only have telephone networks to use their internet access, due to the high cost of high-speed digital satellite-based networks.  Many people can only access the internet on public WiFis.

Explanation:

According to wikipedia.com, "Internet access is the ability of individuals and organizations to connect to the Internet using computer terminals, computers, and other devices; and to access services such as email and the World Wide Web."

8 0
4 years ago
it is a program a personal computer microprocessor uses to get the computer system started after you turn it on​
Fofino [41]

Explanation:

please repeat your question

5 0
3 years ago
What are the two contextual tabs that appear when working with PivotTables?
Nutka1998 [239]

Answer:

<u>D.Analyze and Design</u>

8 0
3 years ago
Read 2 more answers
Other questions:
  • Orphan record example?
    8·1 answer
  • Which function returns a valid value without any arguments?
    14·2 answers
  • A customer asks you over the phone how much it will cost to upgrade memory on her desktop system to 16 GB. She is a capable Wind
    8·1 answer
  • Formulate it as a tree search problem.
    15·1 answer
  • What are the basic features of Usenet group
    15·1 answer
  • NEED ANSWERS ASAP
    6·2 answers
  • Globalization is based on <br>​
    10·1 answer
  • Which engineer may design a GPS for a vehicle?
    15·1 answer
  • You just upgraded five computers with new, larger, hard drives. Now you would like to securely repurpose the old hard drives so
    13·1 answer
  • Write a C++ line of code to declare a variable of type “double” that signifies the average of student grades, then initialize th
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!