Skip to content

Pratik bhujbal 117555295 #5

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

Open
wants to merge 17 commits into
base: master
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 0 additions & 6 deletions .gitmodules

This file was deleted.

40 changes: 0 additions & 40 deletions .travis.yml

This file was deleted.

10 changes: 0 additions & 10 deletions .vscode/.cmaketools.json

This file was deleted.

33 changes: 0 additions & 33 deletions .vscode/c_cpp_properties.json

This file was deleted.

26 changes: 0 additions & 26 deletions .vscode/settings.json

This file was deleted.

147 changes: 0 additions & 147 deletions .ycm_extra_conf.py

This file was deleted.

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# ENPM808X-Software-Development-for-Robotics
Repository for projects and assignments for Software Development Course
File renamed without changes.
3 changes: 1 addition & 2 deletions CMakeLists.txt → Week 3/Accelerated_C++_3_5/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
# We probably don't want this to run on every build.
option(COVERAGE "Generate Coverage Data" OFF)


if (COVERAGE)
include(CodeCoverage)
set(LCOV_REMOVE_EXTRA "'vendor/*'")
setup_target_for_coverage(code_coverage test/cpp-test coverage)
set(COVERAGE_SRCS app/main.cpp include/lib.hpp)

SET(CMAKE_CXX_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage")
SET(CMAKE_C_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage")
Expand All @@ -26,4 +26,3 @@ set(CMAKE_CXX_STANDARD 14)

add_subdirectory(app)
add_subdirectory(test)
add_subdirectory(vendor/googletest/googletest)
Binary file not shown.
59 changes: 59 additions & 0 deletions Week 3/Accelerated_C++_3_5/app/Accelerated_C++_3_5.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
//! "Copyright [2021] None"
/**
* @file AcceleratedC++_3_5.cpp
* @author PratikBhujbal
* @date 16 September 2021
* @brief Week3 assingment problem 3.5 from Accelerated C++ book
* @section DESCRIPTION
*
* This is a program that reads from a standard input stream
* for a list of students, homework grade and prints out the students' name and
* their corresponding final grade.
*/

#include <iostream>
#include <vector>
#include <string>

int main() {
std::vector<std::string> studentNames; ///< Vector of student names
std::vector<int> studentGrades; ///< Vector of student final grades

bool pushList = true;
while ((pushList)) {
std::cout << "Enter Student name: " << std::endl;
std::string studentName;
std::cin >> studentName;
// Prompt user input for each student's name and grades
studentNames.push_back(studentName);
std::cout << "Enter your final exam grade (from 0-10):";
int finalGrade;
std::cin >> finalGrade;

std::cout << "Enter your Homework grade (from 0-10):";
int homeworkGrade; ///< local int variables to hold homework grade
std::cin >> homeworkGrade;
double studentFinalGrade = 0.3 * homeworkGrade + 0.7 * finalGrade;
studentGrades.push_back(studentFinalGrade);

// Ask user if needs to add more
std::cout << "Need to add more? (y/n)" << std::endl;
char answer;
std::cin >> answer;
if (answer == 'n' || answer == 'N') {
pushList = false;
std::cout << "Final Result:" << std::endl;
for (unsigned int i = 0; i < studentNames.size(); i++) {
std::cout << " " << std::endl;
std::cout << "Student Name: " << studentNames.at(i) << " " << "Grade: "
<< studentGrades.at(i) << std::endl;
}
} else if (answer == 'y' || answer == 'Y') {
} else {
std::cout << "Please enter valid Input! " << std::endl;
pushList = false;
}

return 0;
}
}
4 changes: 4 additions & 0 deletions Week 3/Accelerated_C++_3_5/app/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
add_executable(Accelerated_C++_3_5 Accelerated_C++_3_5.cpp)
include_directories(
${CMAKE_SOURCE_DIR}/include
)
File renamed without changes.
Loading