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
Illusion [34]
3 years ago
11

Write a program with a function that accepts a string as an argument and returns a copy of the string with the first character o

f each sentence capitalized. The program should let the user enter a string and then pass it to the function, printing out the modified string.
Computers and Technology
1 answer:
soldi70 [24.7K]3 years ago
3 0

Answer:

import java.util.Scanner;

public class Main

{

public static void main(String[] args) {

 System.out.println("Enter String");

 Scanner sc1=new Scanner(System.in);

 String st1=sc1.nextLine();

 convertfirstchartoupper(st1);

 //System.out.println(st1);

 

}

private static void convertfirstchartoupper(String st1){

     

      char[] arr = st1.toCharArray();

      int k =0;

      arr[0]=Character.toUpperCase(arr[0]);

      while(k<arr.length)

      {

         

         if(Character.isWhitespace(arr[k]))

         {

             

             arr[k+1]=Character.toUpperCase(arr[k+1]);

             

         }

         

         

        k++;

      }

      k=0;

       while(k<arr.length)

      {

         

        System.out.print(arr[k]);

         

        k++;

      }

  }

}

Explanation:

In the above java program, we change a string into an array of characters and then check for whitespace. the letter next to while space is the first letter of the new word, and hence we capitalize that letter. And this is what is required. However, we can split the sentence into a string of words as well, and then capitalize the first letter of each word.

You might be interested in
Inaccurate __________ is the number-one reason why many small businesses go bankrupt.
givi [52]

Answer:

Option B

Explanation:

The top most reason for the bankruptcy of many small businesses is the inaccurate credit management.

Credit management deals with granting credits, recovery of credit granted on its due time,  terms of grant of credits, other related issues and to make sure it comply with the company's policies.

The main aim of credit management is to work for the improvement of profits generated and the revenues within a bank or a firm.

Therefore, any inaccuracy in these will result in major set back to many small businesses.

4 0
3 years ago
The first line of defense against illicit use of, or threats to, computer resources and sensitive information is a strong authen
Ksju [112]

Answer: Authorization process

Explanation

Authorization is a security measure to determine the access levels or user/client rights to use to system resources like files, computer programs, data and other features on a computer. Authorization process is the process of granting or denying access to a network resource that allows the user access to various resources based on the his/her identity.

Most web security systems are based on a two-step Authorization process. The first step ensures and approves the user's identity, that is authentication and the second stage is authorization, which allows the user to access the various resources based on the user's identity.

Therefore the first thing you should do when you suspect "illicit use of, or threats to, computer resources and sensitive information is a strong authentication and authorization process".

5 0
4 years ago
Why is cyberbullying so devastating to many people beyond just the victim?
Lynna [10]

Answer: If the situation goes undetected, it can lead to serious situations, self-harm, and damaged relationships. According to Superintendent Alex Geordan, some common long-term effects of cyberbullying include depression, low self-esteem, unhealthy addictions, trust issues, and poor mental health.

6 0
3 years ago
Wish I could give you a 1,000/5
emmainna [20.7K]

Is this a question or you mean you wish you could give people 1,000 points?

7 0
3 years ago
Does technology get in the way of learning ?<br> Help Meh ! ♥ Some ideas :D
Nady [450]
Yes, and no, social network can distract a student like YouTube or face book, while it can be used as a tool for studying and to put your google documents in the cloud. plus if a teacher posts homework on his/her website, and you happen to forget the paper bringing it home, you can just simply print it instead of having to explain to the teacher
6 0
3 years ago
Read 2 more answers
Other questions:
  • Business ethics are?
    9·1 answer
  • Open Source software is:
    6·1 answer
  • A classmate is texting a false rumor around school that another student was arrested for shoplifting. This behavior can be descr
    9·2 answers
  • A production house needs an operating system that captures, saves, and generates information within specific time. Which type of
    13·2 answers
  • PLEASE FASTTTTT
    8·2 answers
  • Join me to play mm2<br><br><br>in r0bl0x​
    6·2 answers
  • Many companies ban or restrict the use of flash drives
    11·1 answer
  • PROGRAM LANGUAGE C
    5·1 answer
  • A manager suspects that one of his team members has been fraudulently accessing confidential and sensitive information and breac
    8·2 answers
  • Since data-flow diagrams concentrate on the movement of data between processes, these diagrams are often referred to as: A. flow
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!