lab11_7985 - CSE1222 Spring 2016 CS&E 1222 Lab 11 Strings...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE1222 Spring 2016 CSE1222 Lab 11 1 CS&E 1222 Lab 11 Strings & Vectors Lab Assignment 20 points The lab must be accomplished solely by you: DO NOT look at anyone’s code other than your own , including code from another’s student in your section or another section of the course, or any third party source, e.g. the Internet DO NOT share or copy anyone else’s code for any graded assignment DO NOT work in pairs or groups All cases of academic misconduct will be reported to the Committee On Academic Misconduct (COAM). Setting up the Programming Environment Effective commenting and tabbing will affect your grade. The “style” of your program should follow the style of the sample programs in the lecture notes. Also see the example code from Lab #1. Your program should have the file name, your name, creation and last modification dates and a brief description of the program in the comments. In addition, read the document on “Commenting” found in the Content tab on Carmen under “Tutorials” . 1. At the Linux command line type mkdir lab11 . This will create a new directory named lab11 . Work out of this directory. In order to do that, type cd lab11 . This changes the current working directory to the directory lab11 . 2. If you have created the directory lab11 , then just type cd lab11 . 3. Copy the file freq_template.cpp by typing cp /class/cse1222/7985/lab11/freq_template.cpp freq.cpp 4. Copy the file freq_solution.exe by typing cp /class/cse1222/7985/lab11/freq_solution.exe . Be sure to include 7985 (this is your course section indicator) and the period, “.”. Programming Assignment Write a program in the file freq.cpp which reads text from the user and then computes the frequency of each vowel as well as the number of consonants that appear in the text. A vowel is one of the letters a , e , i , o , u , or y . Note that y can be considered to be a vowel or a consonant. We will count a lower case or capitalized version of a letter the same. The frequency of a letter in some text is the number of times it appears in that text, i.e its count. For example, the vowels in the fo llowing text “ I thrive on three tastes: Sweet, TANGY, and Salty! ” have the following frequencies: a occurs 4 times, e occurs 6 times, i occurs 2 times, o occurs 1 time, u occurs 0 times, and y occurs 2 times. The text has 23 consonants. Note that non-alphabetic characters are
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
CSE1222 Spring 2016 CSE1222 Lab 11 2 ignored and so not counted. Besides the space character, you can assume that the user will not
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern