0% found this document useful (0 votes)
77 views5 pages

String Manipulation V1.1

This document provides requirements and a class diagram for a Java string manipulation program. The program will ask a user to input a sentence and output the number of vowels, consonants, special characters, digits, and uppercase characters in the sentence. It describes creating packages and classes to separate the main logic from business logic and output display. The main class will take input, call manipulation methods, and display results, while a utility class will contain the manipulation methods without output display. A constants class will hold special character constants.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
77 views5 pages

String Manipulation V1.1

This document provides requirements and a class diagram for a Java string manipulation program. The program will ask a user to input a sentence and output the number of vowels, consonants, special characters, digits, and uppercase characters in the sentence. It describes creating packages and classes to separate the main logic from business logic and output display. The main class will take input, call manipulation methods, and display results, while a utility class will contain the manipulation methods without output display. A constants class will hold special character constants.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Simple String Manipulation

What you will learn

- Dividing a program into different classes and package


- How different classes serve different purpose ( busins
- How to use Constant in different file
- How to use String class method
- Separate mehod for performing business logic/ operat
and
displaying output.
ation

s and packages
rpose ( businss logic)

s logic/ operation
Requirement
You have to create a core java String Manipulation Program whcih will perform tasks upon execution
of the program.
User will be asked to input a sentence
1. Number of vowles present in the sentence
2. Number of consonants
3. Number of special character within ( ^, &, #,$)
4. Number of digits
5. Number of uppercase characters

Your program will ask user to input like below


Enter your sentence:
AMv6iB^%01GhuPo$@ p$6#1&
Here is the output
[ Result of Manipulation ]
1. Number of vowels: 4
2. Consonants: 6
3. Number of special characters: 5
4: Number of digits: 5
5. Number of uppercase characters:5
Class Diagram
Your Project name will be StringManipulationTask
Create below package app and util under java
StringManipulationTask.java
This is the main class which will take user input, do not write any business login within the main class.
Display results within this class in a private method called
showResults( int vowelsCnt, int consonantsCnt, int digitsCnt, int specCharsCnt, int upperCaseCnt){}
MyStringUtil.java
This class is responsible for performing all calculation, manipulation and return the result.
Do not display any result within this class.
AppConst
This class will holds all user defined constants

Package: com.fujitsu.task.app Package: com.fujitsu.task.

StringManipulationTask.java MyStringUtil.java

- Take user input Main manipulation class


- Initialize MyStringUtil class object method like
- Call each functions to perform individual manipulation int countVowels()
- Display results int countDigits()
within this class.

For more please downoa


AppConst
Defined the special characters which we count in this class.
n the main class.

erCaseCnt){}

ult.

ackage: com.fujitsu.task.app.util

MyStringUtil.java

Main manipulation class you have to define the manipulation


method like
nt countVowels()
nt countDigits()
within this class.

For more please downoad the skeleton app.

You might also like