Write a program that reads string that consists of (Upper case, Lower case, and Digits) including...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program that reads string that consists of (Upper case, Lower case, and Digits) including white spaces from the keyboard until user enters '#'. Then, your program should count total number of characters, uppercase letters, lowercase letters, and digits. Example of a possible input: Hello, welcome to Tempe. Today's temperature is 117!# Approach: Hint: First write the algorithm Come up with a flowchart that represents the program logic. verify your approach with sample data set Develop the program and test it for various inputs You will need to use selection within the while loop. Write a program that reads string that consists of (Upper case, Lower case, and Digits) including white spaces from the keyboard until user enters '#'. Then, your program should count total number of characters, uppercase letters, lowercase letters, and digits. Example of a possible input: Hello, welcome to Tempe. Today's temperature is 117!# Approach: Hint: First write the algorithm Come up with a flowchart that represents the program logic. verify your approach with sample data set Develop the program and test it for various inputs You will need to use selection within the while loop.
Expert Answer:
Answer rating: 100% (QA)
Algorithm 1 Initialize variables totalCharacters uppercaseCount lowercaseCount digitCount as 0 2 Rea... View the full answer
Related Book For
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch
Posted Date:
Students also viewed these programming questions
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
Examine the following program: class Exercise1 { public static void main (String[] args ) { int[] val = {0, 1, 2, 3}; sum = System.out.println( "Sum of all numbers = " + sum ); } } Complete the...
-
Three Zero Coupon Bonds (ZCB) are issued on the market. They each have face value of 100 and maturity, respectively, of 1 year, 3 years and 4 years. Assume the first bond is sold for 99.01, the...
-
The volatility of the market portfolio is 10% and it has an expected return of 8%. The risk-free rate is 3%. a. Compute the beta and expected return of each stock. b. Using your answer from part a,...
-
Cardinal Company is considering a five-year project that would require a $2,975,000 investment in equipment with a useful life of five years and no salvage value . The company's discount rate is 14%....
-
Using MATLAB, solve the simple pendulum equations, Eqs. (E.1)-(E.3), given in Example 13.6, for the following data: \[\omega_{0}=0.1, \quad \theta(0)=0.01, \quad \dot{\theta}(0)=0\] Data From Example...
-
Otis Thorpe Corporation has 10,000 shares of $100 par value, 8%, preferred stock and 50,000 shares of $10 par value common stock outstanding at December 31, 2008. Instructions Answer the questions in...
-
Marigold Corp. purchases a patent for $198,000 on January 2, 2022. Its estimated useful life is 18 years. (a) Prepare the journal entry to record amortization expense for the first year. (Credit...
-
Halcrow, Inc. expects to replace a downtime tracking system currently installed on CNC machines. The challenger system has a first cost of $70,000, an estimated AOC of $20,000 the first year...
-
Let f(x) = x+1 10x 2 x-1 and g(x) = x + 2x - 3 Simplify f(x)g(x): The values of x that need to be excluded from the do
-
What magnitude impulse will give a 2.0-kg object a momentum change of magnitude + 50 kg. m/s? A. +25 N s B. -25 N s C. +50 N s D. -50N s E. +100 N. S ans: C
-
5. A box is pushed with a constant velocity across a desk with an applied force of 12 N [E]. The box has a mass of 40 kg. a. Draw a free body diagram of the box. (1 mark) b. What is the normal force...
-
7. A student sets up an experiment using a linear air track as shown pulley light gate card vehicle small holes linear stopclock air track thread timer hanging mass 0-75 m floor not to scale A...
-
Two point charges, 91 = 1.6 x 107 C and 92 ---Select--- = (a) What is the electric field (in N/C) at a point 5.0 cm from the negative charge and along the line between the two charges? magnitude N/C...
-
Two small metallic spheres, each with a mass of m = 8.00 g, are suspended from a common point by two strings of negligible mass of length L = 59.0 cm. When the spheres have an equal amount of charge,...
-
Based on the following data, what is working capital? Accounts payable $30,000 Accounts receivable 60,000 Accrued liabilities 4,000 Cash 60,000 Intangible assets 50,000 Inventory 69,000 Long-term...
-
Federated Shipping, a competing overnight delivery service, informs the customer in Problem 65 that they would ship the 5-pound package for $29.95 and the 20-pound package for $59.20. (A) If...
-
Write a recursive method that will remove all the vowels from a given string and return what is left as a new string. Use the + operator to perform string concatenation to construct the string that...
-
A single bit can represent two values: 0 and 1. Two bits can represent four values: 00, 01, 10, and 11. Three bits can represent eight values: 000, 001, 010, 011, 100, 101, 110, and 111. How many...
-
Write a program to enter employee data, including Social Security number and salary, into an array. The maximum number of employees is 100, but your program should also work for any number of...
-
Describe the principle parts of a lathe with a neat sketch.
-
How a lathe is specified? Explain with a neat diagram.
-
How do you classify a lathe? Explain briefly.
Study smarter with the SolutionInn App