This is the requested code in java.
public class CharTest {
public static String checkCharacter(String text, int index) {
if (0 <= index && index <= text.length()) {
char ch = text.charAt(index);
if (Character.isLetter(ch)) {
return ch + " is a letter";
} else if (Character.isDigit(ch)) {
return ch + " is a digit";
} else if (Character.isWhitespace(ch)) {
return ch + " is a whitespace character";
} else {
return ch + " is an unknown type of character";
}
} else {
return "index " + index.toString() + " is out of range";
} // end if
} // end function checkChar()
public static void main(String[] args) {
// Test the three samples from the specification.
System.out.println(checkCharacter("happy birthday", 2));
System.out.println(checkCharacter("happy birthday", 5));
System.out.println(checkCharacter("happy birthday 2 you", 15));
} // end function main()
} // end class CharTest
The function checkcharacter(text, index) returns a string value describing the kind of character found at the position in text specified by index; whether it was a letter, digit, whitespace, or an unknown kind of character.
How it does that is to make use of respective functions defined within the Character class in java. That is
isLetter(char) returns a bool specifying if the char parameter is a letter.isDigit(char) returns a bool specifying if the char parameter is a digit.isWhitespace(char) returns a bool specifying if the char parameter is a whitespace character.It calls these functions in an if statement. These else part of the if statement is then executed if the character is neither a letter, digit, or whitespace.
Finally, the function main() calls checkCharacter() three times to test the function and return the results to the console.
Another example of a java program on characters is found in the link below
https://brainly.com/question/15061607
You modified the GreenvilleRevenue program to include a number of methods. Now modify every data entry statement to use a TryParse() method to ensure that each piece of data is the correct type. Any invalid user entries should generate an appropriate message, and the user should be required to reenter the data.
using System;
using static System.Console;
class GreenvilleRevenue
{
static void Main(string[] args)
{
const int fee = 25;
int lastYearsContestants;
int thisYearsContestants;
const int LOW = 0;
const int HIGH = 30;
int other = 0;
int dancer = 0;
int musician = 0;
int singer = 0;
WriteLine("**********************************");
WriteLine("* The stars shine in Greenville. *");
WriteLine("**********************************");
WriteLine("");
lastYearsContestants = getContestantsNum(message, LOW, HIGH);
string[] contestant = new string[thisYearsContestants];
string[] talent = new string[thisYearsContestants];
getContestantsInfo(contestant, talent);
for (int x = 0; x < talent.Length; ++x)
{
if (talent[x] == "O")
{
++other;
}
else if (talent[x] == "S")
{
++singer;
}
else if (talent[x] == "D")
{
++dancer;
}
else if (talent[x] == "M")
{
++musician;
}
}
Clear();
WriteLine("Currently signed up, there are..");
WriteLine("{0} dancers", dancer);
WriteLine("{0} singers", singer);
WriteLine("{0} musicians", musician);
WriteLine("{0} everything else!", other);
contestantByTalent(contestant, talent);
Clear();
contestantInfo(thisYearsContestants, lastYearsContestants, fee);
}
static int getContestantsNum(string message, int LOW, int HIGH)
{
WriteLine("Please enter the number of contestants for last year.>>");
string input = ReadLine();
int contestantsNum = Convert.ToInt32(input);
while (contestantsNum < LOW || contestantsNum > HIGH)
{
WriteLine("Valid numbers are 0 through 30, Please try again.>>");
contestantsNum = Convert.ToInt32(ReadLine());
}
return contestantsNum;
WriteLine("Please enter the number of contestants for this year.>>");
string input = ReadLine();
int contestantsNum = Convert.ToInt32(input);
while (contestantsNum < LOW || contestantsNum > HIGH)
{
WriteLine("Valid numbers are 0 through 30, Please try again.>>");
contestantsNum = Convert.ToInt32(ReadLine());
}
return contestantsNum;
}
static string getTalent(int contestantsNum)
{
bool correct = false;
string talentType = "";
while (!correct)
{
WriteLine("What is contestant " + contestantsNum + "'s skill? Please enter 'S' for Singer, 'D' for Dancer, 'M' for " +
"Musician, 'O' for Other.>>");
talentType = ReadLine().ToUpper();
if (talentType == "S" || talentType == "D" || talentType == "M" || talentType == "O")
{
correct = true;
}
else
{
WriteLine("Please enter a valid response.>>");
}
}
return talentType;
}
static void contestantByTalent(string[] contestant, string[] talent)
{
WriteLine ("To see a list of all contestants with a specific talent, Please enter a talent code.talent codes are(S)inger, (D)ancer, (M)usician, (O)ther; altenatively, you may type (E) to exit.>>");
string entry = ReadLine().ToUpper();
while (entry != "E")
{
if (entry != "S" && entry != "D" && entry != "M" && entry != "O")
{
WriteLine("That wasn't a valid talent code. Valid talent codes are (S)inger, (D)ancer, (M)usician, (O)ther; altenatively, you may type (E) to exit.>>");
entry = ReadLine().ToUpper();
if (entry == "E")
break;
}
for (int x = 0; x < talent.Length; ++x)
{
if (entry == talent[x])
WriteLine("Contestant " + contestant[x] + " talent " + talent[x]);
}
WriteLine("To see a list of all contestants with a specific talent, Please enter a talent code. talent codes are (S)inger, (D)ancer, (M)usician, (O)ther; altenatively, you may type (E) to exit.>>");
entry = ReadLine().ToUpper();
}
}
static void getContestantsInfo(string[] contestant, string[] talent)
{
for (int x = 0; x < contestant.Length; ++x)
{
WriteLine("What is the name for Contestant " + (x + 1) + "?");
contestant[x] = ReadLine();
talent[x] = getTalent(x + 1);
}
}
static void contestantInfo (int thisYearsContestants, int lastYearsContestants, int fee)
{
if (thisYearsContestants > lastYearsContestants * 2)
{
WriteLine("The competition is more than twice as big this year!");
WriteLine("The expected revenue for this year's competition is {0:C}", (thisYearsContestants * fee));
}
else
if (thisYearsContestants > lastYearsContestants && thisYearsContestants <= (lastYearsContestants * 2))
{
WriteLine("The competition is bigger than ever!");
WriteLine("The expected revenue for this year's competition is {0:C}", (thisYearsContestants * fee));
}
else
if (thisYearsContestants < lastYearsContestants)
{
WriteLine("A tighter race this year! Come out and cast your vote!");
WriteLine("The expected revenue for this year's competition is {0:C}.", (thisYearsContestants * fee));
}
}
}
Tamanika got a raise in her hourly pay, from $15.90 to $17.65. Find the percent increase
Which statement best explains how the main idea relates to taking notes?
The main idea is always included in effective notes.
The main idea is always easy to identify.
The main idea is rarely used as a title for notes.
The main idea is rarely identified by listening or reading
Answer:
The main idea is always included in effective notes.
Answer:
a
Explanation:
I did the quiz
How does a computer work?
Answer:
A computer is a Device that can run multiple applications at a time and access the internet where you can find online stores and more also used to make video calls and more.
camera mount that is worn over the shoulders of a camera operator. What is it called?
the reasons why business processes are necessary in a company
Before knowing why they are necessary, let me explain what a business process is to be clear so you can understand a little bit more before I get to the meat. When a group of people work together to accomplish a certain goal, the process is called a "business process." A participant is assigned a task at each step of a business process. To put it another way, it serves as the foundation for several related concepts such as business progress management and process automation
The importance of a business process.In big firms, having a business process is a must, and the advantages of doing so are immediately apparent. Organizations are made up of processes, which allow them to streamline and maximize the utilization of resources at the same time.
Reasons to have a well-defined business processIdentify which tasks are the most important to your larger business goalsImprove efficiencyStreamline communicationSet approvals to ensure accountability and an optimum use of resourcesPrevent chaos from lurking and lingering in your daily operationsStandardize a set of procedures to complete tasks that really matter to your business and tie it togetherReduction of risks from BPM softwareElimination of redundanciesMinimized costsImproved collaborationImproved productivity so that means more moneyHigher efficiencyHigher complianceAnswer:
Key reasons to have well-defined business processes
Identify what tasks are important to your larger business goals. Improve efficiency. Streamline communication between people/functions/departments. Set approvals to ensure accountability and an optimum use of resources.Describe the two problems that appear in the construction of large programs that led to the development of encapsulation constructs.
Two problems that can lead to the development of encapsulation constructs when creating large programs are the complexity of data and the lack of security in sensitive data.
We can arrive at this answer because:
Encapsulation constructs are designed to prevent data from being invaded by unauthorized person.These constructions must be done without causing inconsistencies in the system, interfering with codes, and increasing the complexity of data. For this reason, large programs that present high complexity and difficult codes, demand the use of encapsulation constructs, so that their data does not become more complex.Encapsulation constructs are also necessary when there are flaws in data security and it is not possible to keep them away from the attack by intruders.Although there are other ways to accomplish these goals, encapsulation constructs are widely used because of their simplicity and efficiency.
More information:
https://brainly.com/question/13438419
Please describe how you can use the login page to get the server run two SQL statements. Try the attack to delete a record from the database, and describe your observation.
Question # 1 Multiple Select Which features are important when you plan a program? Select 4 options. Knowing what information is needed to find the result. Knowing what information is needed to find the result. Knowing what the user needs the program to accomplish. Knowing what the user needs the program to accomplish. Knowing how many lines of code you are allowed to use. Knowing how many lines of code you are allowed to use. Knowing what you want the program to do. Knowing what you want the program to do. Knowing how to find the result needed. Knowing how to find the result needed.
Answer:
c
Explanation:
Answer:
Knowing what the user needs the program to accomplish.Knowing how to find the result needed.Knowing what information is needed to find the result.Knowing what you want the program to doExplanation:
:D
Write a recursive function called DigitCount() that takes a positive integer as a parameter and returns the number of digits in the integer. Hint: The number of digits increases by 1 whenever the input number is divided by 10. Ex: If the input is:
Recursive functions are functions that are called from within itself
The recursive function DigitCount() in Python where comments are used to explain each line is as follows:
#This defines the function
def countDigits(n):
#If the integer is less than 10
if n< 10:
#Then the integer has 1 digit
return 1
#Otherwise,
else:
#Count the number of integers
return 1 + countDigits(n / 10)
At the end of the function, the count of integers is returned to the main function
Read more about similar programs at:
https://brainly.com/question/20397067
You work in an office that uses Linux and Windows servers. The network uses the IP protocol. You are sitting at a Windows workstation. An application you are using is unable to connect to a Windows server named FileSrv2. Which of the following commands would work BEST to test network connectivity between your workstation and the server?
a. arp
b. dig
c. tracert
d. nslookup
e. ping
Answer:
ping
Explanation:
its ping. im a computer science nerd :')
Fill in the blank: _____ data are statistical and numerical facts about a project.
Subjective
Quantitative
Mathematical
Qualitative
Quantitative data are statistical and numerical facts about a project that can be counted, measured or expressed using numbers.
Quantitative data is statistical and its nature is usually structured, it uses numbers and values that are most suitable for the analysis of a project.
The collection of quantitative data offers the possibility of statistical analysis.This type of data allows you to easily measure and quantify facts in an organized and accessible way within relational databases.Therefore, we can conclude that quantitative data is data that comes from numerical information, quantities, percentages, proportions and statistics.
Learn more about quantitative data here: https://brainly.com/question/96076
What is the grooming process as it relates to online predators
the process by which online predators lure in minors to get close enough to hurt them.
The capability of moving a completed programming solution easily from one type of computer to another is known as ________. Group of answer choices
Answer: Portability
Explanation: I hope it helps you!
The system tray contains _____.
A. the battery life
B. the computer's hard drive
C. the operating system
D. Quick Launch
The notification area (also called the "system tray") is located in the Windows Taskbar, usually at the bottom right corner. It contains miniature icons for easy access to system functions such as antivirus settings, printer, modem, sound volume, battery status, and more.
Answer:
A BATTERY LIFEExplanation: The person said it and it was right I believed them, and they made me get a 100% thank you sir/madam and as you can see, I have proof so your welcome and thank you.I Wouldn't just say the letter like A or C because everyone's quiz is different, and it changes but either way whatever your welcome and again thank you.how can computers be a threat to public safety??
help asap marking brainiest
Today we see the advantages as well as disadvantages of a wired network. In comparison what technology would you recommend Wired Ethernet or a Wireless network technology for home and what would you recommend for business? Explain your answer
Answer:
wired network
Explanation:
Wired networks are generally much faster than wireless networks. ... This is mainly because a separate cable is used to connect each device to the network with each cable transmitting data at the same speed. A wired network is also faster since it never is weighed down by unexpected or unnecessary traffic.
hope that helps your welcome
Write a program, using case statements, that mimics a calculator. The program should take as input two integers and the operation to be performed. It should then output the numbers, the operator, and the result. For division, of the denominator is zero, output an appropriate message.
Answer:#include<iostream>
using namespace std;
int main() {
int var1, var2;
char operation;
cout << "Enter the first number : ";
cin >> var1;
cout << endl;
cout <<"Enter the operation to be perfomed : ";
cin >> operation;
cout << endl;
cout << "Enter the second nuber : ";
cin >> var2;
cout << endl;
bool right_input = false;
if (operation == '+') {
cout << var1 << " " << operation << " " << var2 << " = " << (var1 + var2);
right_input = true;
}
if (operation == '-') {
cout << var1 << " " << operation << " " << var2 << " = " << (var1 - var2);
right_input = true;
}
if (operation == '*') {
cout << var1 << " " << operation << " " << var2 << " = " << (var1 * var2);
right_input = true;
}
if (operation == '/' && var2 != 0) {
cout << var1 << " " << operation << " " << var2 << " = " << (var1 - var2);
right_input = true;
}
if (operation == '/' && var2 == 0) {
cout << "Error. Division by zero.";
right_input = true;
}
if (!right_input) {
cout << var1 << " " << operation << " " << var2 << " = " << "Error;";
cout << "Invalid Operation!";
}
cout << endl;
system("pause");
return 0;
}
Explanation:
what are the main barriers to the adoption of an industry standard for internet system
Answer:
Industry experts say that although many companies find the potential of the Internet of Things very attractive, they either lack a clear value proposition for end-users or lack interoperability.
Consider the conditions and intentions behind the creation of the internet—that it was initially created as a tool for academics and federal problem-solvers. How might that explain some of the security vulnerabilities present in the “cloud” today?
It should be noted that the intention for the creation of the internet was simply for resources sharing.
The motivation behind the creation of the internet was for resources sharing. This was created as a tool for academics and federal problem-solvers.
It transpired as it wasn't for its original purpose anymore. Its users employed it for communication with each other. They sent files and softwares over the internet. This led to the security vulnerabilities that can be seen today.
Learn more about the internet on:
https://brainly.com/question/2780939
What type of database replication relies on centralized control that determines when replicas may be created and how they are synchronized with the master copy
Database replication is very common in this Era. Traditional database replication is relies on centralized control that determines when replicas may be created and how they are synchronized with the master copy.
Database replication is known to be the constant electronic copying of data from a database using one computer or server that is connected also to a database in another . this ensure that all users do share the same level of information.
Replication is often done to technologies which are used for copying and distributing data and database objects from one database to another and thereafter use in synchronizing between databases.
Conclusively, Replicas can only be made in the Traditional database replication through the power of centralized control.
See full question below
What type of database replication relies on centralized control that determines when replicas may be created and how they are synchronized with the master copy?
a distributed database model
b. traditional database replication
c. enterprise replication
d. local database model
Learn more about database replication from
https://brainly.com/question/6447559
Viewing digital content
Digital Content Creation Platforms offer content subscription or pay-as-you-go services for organizations. ... By offering access to this media, Digital Content Creation platforms make it so that organizations can share media of social interest while still complying with copyright laws.
Two categories of estimation mode
Answer:
The Standard Parametric Mode (SPM) and the Robust Parametric Mode (RPM) are two categories of estimation mode. These approaches turn the data distribution into an approximation normal distribution and then estimate the mode by using the probability density function of the estimated distribution as a guide.
Explanation:
Hope it helps:)
Choose one piece of information your class can know, but you don’t want to share on your website. Why is it okay for your classmates and teacher to know it, but not to post it publicly?
Answer:
because other people you dont know can see it and it can sometimes not be good
Explanation:
What is primary difference between the header section of a document and the body
Answer:
A HTML file has headers and a "body" (payload) — just like a HTTP request. The <body> encapsulates the contents of the document, while the <head> part contains meta elements, i.e., information about the contents. This is (typically) title, encoding, author, styling etc.
Explanation:
CAN I GET BRAINLIEST
How does tracking changes relate to sharing a workbook in Excel?
Answer:When you highlight changes as you work, Excel outlines any revisions (such as changes, insertions, and deletions) with a highlighting color. On the Review tab, click Track Changes, and then click Highlight Changes. Select the Track changes while editing. This also shares your workbook check box.
Explanation:
A workbook in excel is a file that contains one or more worksheets to assist you with data organization.
What is a workbook?A workbook in excel is a file that contains one or more worksheets to assist you with data organization. A blank workbook or a template can be used to build a new workbook.
The Advanced tab of the Share Workbook dialogue box gives further choices for changing how Excel records change. For example, you may choose the "Automatically Every" radio option and enter a value in the "Minutes" text box. If you enter 10, Excel will store changes made by users every 10 minutes.
When you highlight changes while you work, Excel highlights any modifications (such as updates, insertions, and deletions) with a highlighting colour. Track Changes and Highlight Changes may be found on the Review tab. Select the Track changes while editing.
Learn more about Workbook:
https://brainly.com/question/10321509
#SPJ2
computer Graphics:
B. Arbitrary reference point:
1) Apply a rotation by 60° on the Pivot Point (-10, 10) and display it.
2) Apply a rotation by 270° on the Pivot Point (10, 0) and then translate it by tx
= -20 and ty = 5. Display the final result.
What is the best data type for traveling day?
What are 3 things message timing must include
Answer:
1)Message Timing. Another factor that affects how well a message is received and understood is timing. ...
2)Access Method. Access method determines when someone is able to send a message. ...
3)Flow Control. Timing also affects how much information can be sent and the speed that it can be delivered.
Natural language generation is focused on?
While natural language understanding focuses on computer reading comprehension, natural language generation enables computers to write. NLG is the process of producing a human language text response based on some data input. This text can also be converted into a speech format through text-to-speech services.
- BRAINLIEST answerer