Skip to content

Instantly share code, notes, and snippets.

@Jeffrey-Kimani
Created June 15, 2016 11:18
Show Gist options
  • Save Jeffrey-Kimani/dfb92cdd25e48bee717217afb5524007 to your computer and use it in GitHub Desktop.
Save Jeffrey-Kimani/dfb92cdd25e48bee717217afb5524007 to your computer and use it in GitHub Desktop.
Exercise 1...
<?xml version="1.0" encoding="UTF-8"?>
<module type="CPP_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/main.cpp" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/CMakeLists.txt" isTestSource="false" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library">
<library name="Header Search Paths">
<CLASSES>
<root url="file://C:/Program Files (x86)/CodeBlocks/MinGW/lib/gcc/mingw32/4.8.1/include" />
<root url="file://C:/Program Files (x86)/CodeBlocks/MinGW/lib/gcc/mingw32/4.8.1/include-fixed" />
<root url="file://C:/Program Files (x86)/CodeBlocks/MinGW/include" />
</CLASSES>
<SOURCES>
<root url="file://C:/Program Files (x86)/CodeBlocks/MinGW/lib/gcc/mingw32/4.8.1/include" />
<root url="file://C:/Program Files (x86)/CodeBlocks/MinGW/lib/gcc/mingw32/4.8.1/include-fixed" />
<root url="file://C:/Program Files (x86)/CodeBlocks/MinGW/include" />
</SOURCES>
</library>
</orderEntry>
</component>
</module>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
<component name="CidrRootsConfiguration">
<sourceRoots />
<libraryRoots />
<excludeRoots />
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/Exercise1.iml" filepath="$PROJECT_DIR$/.idea/Exercise1.iml" />
</modules>
</component>
</project>
cmake_minimum_required(VERSION 3.5)
project(Exercise1)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(SOURCE_FILES main.cpp)
add_executable(Exercise1 ${SOURCE_FILES})
#include <iostream>
using namespace std;
int main() {
string name,course;
int CurrentYear,YearOfBirth,age;
cout<<"Enter your name: ";
cin>>name;
cout<<"Enter your Course: ";
cin>>course;
cout<<"Enter the current year: ";
cin>>CurrentYear;
cout<<"Enter your Year Of Birth: ";
cin>>YearOfBirth;
age = CurrentYear-YearOfBirth;
cout<<"Hello class my Name is: "<<name<<"and my age is "<<age<<" thank you for being a programmer";
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment