Programming > STUDY GUIDE > utility University of Michigan - EECS 183 (All)
/** * utility.cpp * * Hadianto Leonard & Tian You Guo * leonhadi & kevinguo * * EECS 183: Project 3 * * <#description#> */ #include "utility.h" #include <iostream> string toUpperCase(strin... g original) { string s; // use for loop to check the character one by one for (int i = 0; i < original.size(); i++) { // if the character is in lowercase change it to uppercase if (islower(original[i])) { original[i] = toupper(original[i]); } s += original[i]; } return s; } string removeNonAlphas(string original) { string s; // use for loop to check the character one by one for (int i = 0; i < original.size(); i++) { // if the character is non alpha, remove it if (isalpha(original[i])) { // only return alphabet characters s += original[i]; } } return s; } string removeDuplicate(string original) { string s = ""; bool flag = false; for (int i = 0; i < original.size(); i++) { if (i == 0) { s += original[i]; } else if ( i != 0) { for (int j = i-1; j >= 0; j--) { if (original[i] == original[j]) { flag = true; } } if (flag == false) { s += original[i]; } el [Show More]
Last updated: 1 year ago
Preview 1 out of 2 pages
Instant download
Buy this document to get the full access instantly
Instant Download Access after purchase
Add to cartInstant download
Connected school, study & course
About the document
Uploaded On
Mar 23, 2021
Number of pages
2
Written in
This document has been written for:
Uploaded
Mar 23, 2021
Downloads
1
Views
189
In Browsegrades, a student can earn by offering help to other student. Students can help other students with materials by upploading their notes and earn money.
We're available through e-mail, Twitter, Facebook, and live chat.
FAQ
Questions? Leave a message!
Copyright © Browsegrades · High quality services·