First commit
This commit is contained in:
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Win32",
|
||||
"includePath": [
|
||||
"${workspaceFolder}/**"
|
||||
],
|
||||
"defines": [
|
||||
"_DEBUG",
|
||||
"UNICODE",
|
||||
"_UNICODE"
|
||||
],
|
||||
"cStandard": "c17",
|
||||
"cppStandard": "c++17",
|
||||
"intelliSenseMode": "gcc-x64",
|
||||
"compilerPath": "C:\\msys64\\mingw64\\bin\\g++.exe"
|
||||
}
|
||||
],
|
||||
"version": 4
|
||||
}
|
||||
Vendored
+29
@@ -0,0 +1,29 @@
|
||||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "g++.exe - Build and debug active file",
|
||||
"type": "cppdbg",
|
||||
"request": "launch",
|
||||
"program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
|
||||
"args": [],
|
||||
"stopAtEntry": false,
|
||||
"cwd": "${fileDirname}",
|
||||
"environment": [],
|
||||
"externalConsole": false,
|
||||
"MIMode": "gdb",
|
||||
"miDebuggerPath": "C:\\msys64\\mingw64\\bin\\gdb.exe",
|
||||
"setupCommands": [
|
||||
{
|
||||
"description": "Enable pretty-printing for gdb",
|
||||
"text": "-enable-pretty-printing",
|
||||
"ignoreFailures": true
|
||||
}
|
||||
],
|
||||
"preLaunchTask": "C/C++: g++.exe build active file ver(1)"
|
||||
}
|
||||
]
|
||||
}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"C_Cpp.errorSquiggles": "Disabled",
|
||||
"files.associations": {
|
||||
"iostream": "cpp",
|
||||
"cstdio": "cpp",
|
||||
"string": "cpp"
|
||||
}
|
||||
}
|
||||
Vendored
+46
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"tasks": [
|
||||
{
|
||||
"type": "cppbuild",
|
||||
"label": "C/C++: g++.exe build active file",
|
||||
"command": "C:\\msys64\\mingw64\\bin\\g++.exe",
|
||||
"args": [
|
||||
"-g",
|
||||
"${file}",
|
||||
"-o",
|
||||
"${fileDirname}\\${fileBasenameNoExtension}.exe"
|
||||
],
|
||||
"options": {
|
||||
"cwd": "${fileDirname}"
|
||||
},
|
||||
"problemMatcher": [
|
||||
"$gcc"
|
||||
],
|
||||
"group": "build",
|
||||
"detail": "Task generated by Debugger."
|
||||
},
|
||||
{
|
||||
"type": "cppbuild",
|
||||
"label": "C/C++: g++.exe build active file ver(1)",
|
||||
"command": "C:\\msys64\\mingw64\\bin\\g++.exe",
|
||||
"args": [
|
||||
"-g",
|
||||
"${file}",
|
||||
"-o",
|
||||
"${fileDirname}\\${fileBasenameNoExtension}.exe"
|
||||
],
|
||||
"options": {
|
||||
"cwd": "${fileDirname}"
|
||||
},
|
||||
"problemMatcher": [
|
||||
"$gcc"
|
||||
],
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"detail": "Task generated by Debugger."
|
||||
}
|
||||
],
|
||||
"version": "2.0.0"
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
#include <iostream>
|
||||
|
||||
/*
|
||||
*This was coded by Darrel Israel
|
||||
*Do not change anything!
|
||||
*/
|
||||
|
||||
using namespace std;
|
||||
//Bubble sort algorithm
|
||||
void bubbleSortNamesAscending(string name[], int arr_size)
|
||||
{
|
||||
string temp;
|
||||
for (int i = 0; i < arr_size; i++)
|
||||
{
|
||||
for (int j = i + 1; j < arr_size; j++)
|
||||
{
|
||||
if(name[i] > name[j])
|
||||
{
|
||||
temp = name[i];
|
||||
name[i] = name[j];
|
||||
name[j] = temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
const int arr_size = 10;
|
||||
int age[arr_size];
|
||||
string name[arr_size], temp;
|
||||
//for loop to ask the user for the students name and age
|
||||
for (int i = 0; i < arr_size; i++)
|
||||
{
|
||||
// user input for name
|
||||
cout << "Enter the name of student " << i+1 << ": ";
|
||||
getline(cin, name[i]);
|
||||
cin.clear();
|
||||
}
|
||||
//for loop to display names in ascending order
|
||||
bubbleSortNamesAscending(name, arr_size);
|
||||
for (int i = 0; i < arr_size; i++)
|
||||
{
|
||||
cout << name[i] << " ";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user