Concept explainers
Let s1 be “ Welcome ” and s2 be “ welcome ” Write the code for the following statements:
a. Replace all occurrences of the character e with E in s1 and assign the new string to s3.
b. Split Welcome to Java and HTML into an array tokens delimited by a space and assign the first two tokens into s1 and s2.
Want to see the full answer?
Check out a sample textbook solutionChapter 10 Solutions
Introduction to Java Programming and Data Structures, Comprehensive Version Plus MyProgrammingLab with Pearson EText -- Access Card Package
Additional Engineering Textbook Solutions
Web Development and Design Foundations with HTML5 (9th Edition) (What's New in Computer Science)
Starting Out with C++ from Control Structures to Objects (8th Edition)
Problem Solving with C++ (9th Edition)
Objects First with Java: A Practical Introduction Using BlueJ (6th Edition)
Experiencing MIS
Java How To Program (Early Objects)
- Java Create a string array of 46 names and assign “Washington” to the first element of the array and “Biden” to the last element of the array.arrow_forwardJAVA Programming Problem 5 – CharacterArray Write a program which will store the following string into a character array: 6901 Sudley Road Manassas VA Your program will display each original character, determine and display whether the character is a digit or a letter, and redisplay the character according to the directions below. Directions Create a class called CharacterArray. The scanner class is not required. Initialize the character array with the given string. Write a program which will accept an alpha numeric string at the keyboard. Store the string, of any length, into a character array, for example: RBDB Manassas Campus 6901 Sudley Road Manassas VA 20109 For each visible character: Display the original character Determine and display whether the character is a digit or a letter If the character is a lower case letter, redisplay the character in upper case If the character is a upper case letter, redisplay the character in lower case If the character is a digit, display it…arrow_forward2- Write a C# program that read a string and split this string according to space char into an array of strings using Substring, IndexOf (or LastIndexOf) The book on the Ex : strl ="The book on the table, the pen" -→ result= table the репarrow_forward
- Write a single Java statement to perform each of the following tasks. A) Declare (but do not initialize) a two dimensional array of Strings named schedule. B) Create a two-dimensional String array with 3 rows and 3 columns and store it in a variable named schedule. You should assume that schedule has already been declared. (You do not need to initialize the entries in the array.)arrow_forwardQ1: Define an array of size 10 with predefined names of ten cities. Revise the program to get the cities from the user. Show the code and output screen. Q2: Define an array of size 10 that accepts ten characters of your choice via keyboard and display the same alphabets. Show the code and output screen.arrow_forwardNote: Please use WHILE LOOP and print all the contents of the array. Use java language. Days of the Week. Create an array of Strings which are initialized to the 7 daysof the week. Use while-loop and print all the contents of the array.arrow_forward
- Q3 / Write a program in C # that lets the user to define the number of rows and columns. Then, the program reads the matrix and finds the index of the even and odd numbers and display them with their corresponding indices. Use adequate messages during the program execution.arrow_forwardQ2: Write a C# program that reading an array of teachers' information (tech_name, tech_age, tech_salary and array of school names), reading a single string for each teacher in the following form "(tech_name);>;[school names splitting by space]" and print the information of any teacher has the following: Name does not starts with "Fa" and ending with "ri" Age at most 40 Salary at least 10000 IQD(Iraqi Dinars) Note: structure must be used in above programarrow_forwardWrite a program in C as follows:- Create an array of integers named “toy” that has 120 rows and 4 columns.- The program should repeatedly display the following menu:A or a to add a toy to the bagV or v to calculate and display the total value of the toysW or w to calculate and display the total weight of the toysD or d to delete a toy from the arrayM or m to calculate and display the number of small toysN or n to calculate and display the number of medium toysL or l to calculate and display the number of large toysX or x to start filling a new bagP or p to exit program - Santa’s bag can hold 30 large toys or 60 medium toys or 120 small toys or any combination ofsizes that satisfy this requirement (ex: 29 large + 1 medium + 2 small would be max capacity).Also, the total weight of toys cannot exceed 620 Kgs. All values are entered in centimeters andgrams. (Hint: the return values of the size function should help you in calculating the bagcapacity.)The…arrow_forward
- Write a program in C as follows:- Create an array of integers named “toy” that has 120 rows and 4 columns.- The program should repeatedly display the following menu:A or a to add a toy to the bagV or v to calculate and display the total value of the toysW or w to calculate and display the total weight of the toysD or d to delete a toy from the arrayM or m to calculate and display the number of small toysN or n to calculate and display the number of medium toysL or l to calculate and display the number of large toysX or x to start filling a new bagP or p to exit programThe following functions need to be created and used in the program:- Void wipe(int cat[][4], int n);- Void populate(int cat[][4], int n);- Int size(int L, int W, int H);- Int check_capacity(int cat[][4], int n, int tsize, int tweight);- Int rm_toy(int cat[][4], int n, int toynum);- Int weight(int cat[][4], int n);- Int value(int cat[][4], int n);- Int small(int cat[][4], int n);- Int medium(int cat[][4], int n);- Int…arrow_forwardCreate an array containing the information of 20 books. The information includes name, ISBN, printing time, price and type. Output the information of the latest books, the information of the children's books, the information of IT books with the highest price. Requirement: • Use C++ programming language • Use OOP to define Book classarrow_forward3. Write the code to print the following diamond. Symbol used to draw the diamond and number of rows must be taken as input from the user. Symbols should be in a cell array, and selected using the index taken from the user. Symbol list should include *, +', 'o', respectively. Example output for the program: Enter number of rows: Enter index for the symbol for diamond: 2 +++ +++++ +++++++ +++++++++ +++++++ +++++ +++ +arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education