Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes issues #69 & #68 #141

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: CI Build

on:
pull_request:
branches:
- main #

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Set up GCC
uses: actions/setup-java@v2

- name: Install build tools
run: sudo apt-get install build-essential

- name: Compile the Application
run: g++ main.cpp --std=c++17 -o MyFave

- name: Verify build success
run: ./MyFave \

#Commit error
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[![CI Build](https://github.com/EscGit/MyFave/actions/workflows/ci.yml/badge.svg)](https://github.com/EscGit/MyFave/actions/workflows/ci.yml)
# MyFave

This is a simple C++ command line application to maintain a list of your favorites.
Expand Down
24 changes: 14 additions & 10 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,32 @@

using std::cout, std::cin, std::endl, std::string, std::vector;

int main()
{
int main(){
string input = "";
vector <string> favorites;
vector<string> favorites;

cout << "At any time, type DONE to stop recording favorites.\n";

do
{
if( favorites.size() == 0 )
if( favorites.size() == 0 ){
cout << "What is your favorite?\n";

else
}
else{
cout << "What is your next favorite?\n";

}

}while( input != "DONE" ){
getline(cin,input);
favorites.push_back(input);
}while( input != "DONE" );
}

if (input == "DONE"){
cout << "Your favorite list:\n";
for(int i = 0; i < favorites.size() -1; i++)
cout << favorites.at(i) << endl;
for(const auto& favorite : favorites) {
cout << favorite << endl;
}
}

return 0;
}