1 Project 3 String Methods. Project 3: String Methods Write a program to do the following string manipulations: Prompt the user to enter a phrase and.

Slides:



Advertisements
Similar presentations
Computing Science Software Design and Development SOFTWARE DESIGN AND DEVELOPMENT USING PYTHON.
Advertisements

1 Chapter 2 Introduction to Java Applications Introduction Java application programming Display ____________________ Obtain information from the.
1 September 6, 2005CS150 Introduction to Computer Science I What Actions Do We Have Part 1 CS150 Introduction to Computer Science I.
1 10/25/06CS150 Introduction to Computer Science 1 Reading from and Writing to Files.
Moving To Code 3 More on the Problem-Solving Process §The final step in the problem-solving process is to evaluate and modify (if necessary) the program.
1 Project 6: Cats in Tree. 2 Project 3: Cats in Tree In this project you will Create a class definition for a Cat class. Populate a BST with Cat information.
1 Project 7: Huffman Code. 2 Extend the most recent version of the Huffman Code program to include decode information in the binary output file and use.
© The McGraw-Hill Companies, 2006 Chapter 1 The first step.
1 Project 5: Median. 2 The median of a collection of numbers is the member for which there are an equal number less than or equal and greater than or.
MIS 3200 – Unit 6.2 Learning Objectives How to move data between pages – Using Query Strings How to control errors on web pages – Using Try-catch.
1 Project 7: My Photo Album Graded Project. 2 Assignment Write a web app to permit users to upload and view photos. User can keep up to five photos on.
1 Project 4: XML Product Browser (Not Graded). Objectives This project is an exercise of the following knowledge and skills: Accessing and displaying.
Mastering Char to ASCII AND DOING MORE RELATED STRING MANIPULATION Why VB.Net ?  The Language resembles Pseudocode - good for teaching and learning fundamentals.
1 Introduction to Java Brief history of Java Sample Java Program Compiling & Executing Reading: => Section 1.1.
Getting Started with Java Recitation – 1/23/2009 CS 180 Department of Computer Science, Purdue University.
1 Project 4: Vehicle Inventory. 2 Write a program to read a text file containing information about vehicles and output the information First in the order.
CHAPTER 3 GC Java Fundamentals. 2 BASICS OF JAVA ENVIRONMENT  The environment  The language  Java applications programming Interface API  Various.
1 Project 3: Chomp (Not graded). 2 Project 3 The game of Chomp was described in a Math Trek column in Science News:
1 Project 5: New Venue. 2 New Venue Based on the posted New Venue scenario 077_Ticket_Booth_Scenarios.pdf.
1 Project 7: Northwind Traders Order Entry. 2 Northwind Order Entry Extend the Select Customer program from Project 6 to permit the user to enter orders.
1 Computer Science of Graphics and Games MONT 105S, Spring 2009 Session 1 Simple Python Programs Using Print, Variables, Input.
11 Project 2 Towers of Hanoi. 22 Towers of Hanoi is a well known puzzle that can be very difficult to solve manually but can be programmed very easily.
Chapter 3 Syntax, Errors, and Debugging Fundamentals of Java.
1 Project 5: Printing Address Labels. 2 Assignment Write a Windows forms program to display and print a set of address labels. Input from a csv file.
C++ Basics. Compilation What does compilation do? g++ hello.cpp g++ -o hello.cpp hello.
1 Project 3 The Kumquat Society Conference. 2 Conference Registration In this project you will write a program to handle a conference registration. The.
Validation final steps Stopping gaps being entered in an input.
Project 3: Ticket Printer
1 Project 2: Using Variables and Expressions. 222 Project 2 Overview For this project you will work with three programs Circle Paint Ideal_Weight What.
Introduction to Programming Python Lab 5: Strings and Output 05 February PythonLab5 lecture slides.ppt Ping Brennan
1 Project 1: Tickets. 2 Class Ticket Write a definition for class Ticket. A Ticket object corresponds to a physical ticket for a stage show. Attributes.
1 Project 2: Sorting Cats. Write a C++ console application to read a text file containing information about cats and output the information to the screen.
1 Project 4 Address Lookup. Project 4 Write an ASP.NET app that permits users to retrieve addresses from a potentially large list of addresses. There.
1 Project 3: Farey Sequences. 2 Farey Sequences Further details about Farey sequences, and more examples, can be found in the Wikipedia article:
1 Project 7: Looping. Project 7 For this project you will produce two Java programs. The requirements for each program will be described separately on.
11 Project 2 Temperature Conversion. 22 Project 2: Temperature Conversion Write an ASP.NET Web Forms app to convert temperatures from Fahrenheit to Celsius.
1 Project 5: Leap Years. 222 Leap Years Write a program that reads an integer value from the user representing a year and determines if the year is a.
1 Project 4: Computing Distance. 222 Computing Distance Write a program to compute the distance between two points. Recall that the distance between the.
1 Project 4: Palindrome Detector. 2 Assignment Write a C++ program that reads a line of text from the keyboard and reports to the user whether the text.
1 Project 4: Venue Sort. 2 This project is an exercise in Using C++ strings. Operator overloading. Text File Input.
Strings CSE 1310 – Introduction to Computers and Programming Alexandra Stefan University of Texas at Arlington 1.
An Introduction to Programming with C++ Sixth Edition Chapter 5 The Selection Structure.
Strings CSE 1310 – Introduction to Computers and Programming Alexandra Stefan University of Texas at Arlington 1.
Introduction to Programming Python Lab 8: Loops 26 February PythonLab8 lecture slides.ppt Ping Brennan
1 Project 5 Eyeglass Rx User Control. Eyeglass Rx Earlier in the semester we looked at an eyeglass prescription as an example of an HTML table. 2.
1 Project 15: Animals Using Derived Classes and Inheritance.
1 Project 6: New Venue. 2 New Venue Based on the posted New Venue scenario
1 Project 8: Tic Tac Toe. 2 Assignment Write an HTML and JavaScript page that pemits users to play Tic Tac Toe. Both players use a single browser. Alternating.
1 Project 7: Ticket_Booth_0 Using XML. 2 Ticket Booth 0 Base Level 0 of the real Ticket Booth program. Gets information for a single venue from an XML.
1 Project 12: Cars from File. This is an extension of Project 11, Car Class You may use the posted solution for Project 11 as a starting point for this.
1 Project 6: Northwind Orders. 2 The Northwind Traders Database The Northwind Traders database was created by Microsoft for training and demonstration.
DEVRY CIS 170 C I L AB 5 OF 7 A RRAYS AND S TRINGS Check this A+ tutorial guideline at
MIS 3200 – C# (C Sharp)
CST 1101 Problem Solving Using Computers
Chapter 6 JavaScript: Introduction to Scripting
Chapter 3 Syntax, Errors, and Debugging
Chapter 7 Top-Down Development
Introduction to Programming
The Selection Structure
INPUT STATEMENTS GC 201.
CS 1430: Programming in C++ Turn in your Quiz1-2 No time to cover HiC.
Introduction to Programming
Use proper case (ie Caps for the beginnings of words)
More Loops.
Introduction to Java Brief history of Java Sample Java Program
Functions continued.
String Processing 1 MIS 3406 Department of MIS Fox School of Business
Introduction to Programming
Running a Java Program using Blue Jay.
Hint idea 2 Split into shorter tasks like this.
Presentation transcript:

1 Project 3 String Methods

Project 3: String Methods Write a program to do the following string manipulations: Prompt the user to enter a phrase and read the phrase from the keyboard into variable stringA. Prompt the user to enter another phrase and read this phrase from the keyboard into variable stringB. You may assume that there are at least three characters in each string. Output the number of characters in each string to the screen. Concatenate the two phrases, separated by a space, and output the result to the screen. StringA followed by StringB, with a space between. Call this the composite string. 2

Project 3: String Methods Output the number of characters in the composite string to the keyboard. Should be the sum of the lengths of the two original strings + 1. Replace each of the vowels in the composite string with an asterisk (*) and output the modified string to the screen. Consider the letters A E I 0 and U (upper case and lower case) to be the only vowels. Determine and output the number of characters in the composite string prior to the first vowel. This needs the String method indexOf. See the last two slides of 3

444 Test Data Test your program using the following data: To be or not to be That is the question

555 Sample Run Your output should be similar in format to that shown in the sample run shown below.

666 Writing the Program Start with a stub Just output the initial message. Compile and test after each step. Always have a working program! Add code to get the inputs. Declare variables for the inputs. Instantiate a Scanner Output a promt and read the first phrase from the keyboard. Output a promt and read the second phrase from the keyboard. Temporarily output the strings received (So that you can verify that they were read correctly.)

Writing the Program Determine and output the length of each string. Declare a variable for the composite string. Create and output the composite string. Output the number of characters in the composite string. Replace each of the vowels in the composite string with an asterisk (*) and output the modified string to the screen. Determine and output the number of characters in the composite string prior to the first vowel. 7

Writing the Program At this point your program is complete. If your program compiles without errors and produces the expected output, go back and delete (or comment out) the temporary outputs. 8

999 Submission Put your Java source file into a folder and zip it. Submit your zipped Java source file via Canvas Assignments. Project is due by 11:59 PM Sunday, January 31 Sections 001 and 002 Monday, February 1 Sections 003 and 004

10 Ground Rules Do not share your code with other students Before or after submitting the project. OK to discuss the project. Do not copy any other student’s code. Or even look at it. Do not let anyone copy or examine your code.

Ground Rules Except for code posted on the class web site Do not copy code from the Internet or any other source. Do not ask for help on an Internet forum. Write your own code.