aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Lab5_taormina7
-rw-r--r--mod_10a/main.cpp9
-rw-r--r--mod_10a/source.cpp64
-rw-r--r--mod_10a/source.h15
4 files changed, 88 insertions, 7 deletions
diff --git a/Lab5_taormina b/Lab5_taormina
index b77cb65..32202d6 100644
--- a/Lab5_taormina
+++ b/Lab5_taormina
@@ -155,7 +155,7 @@ CODE:
View code in Folder mod_9b. Contains the three files.
RUN:
-
+t
Enter Score #1 of 10:
99
Enter Score #2 of 10:
@@ -198,7 +198,7 @@ F's: 4
________________________________________________________________________________________________________________________
10a
-9.4 Learn by Doing Exercises
+10.7 Learn by Doing Exercises
p 260
Break into at least 3 files as in 9b.
10 pts #2
@@ -206,10 +206,9 @@ Submit: code & runs
CODE:
RUN:
-GET THIS DONE ASAP!!!
________________________________________________________________________________________________________________________
10b
-9.5 Learn by Doing Exercises
+10.8 Learn by Doing Exercises
p 273
Break into at least 3 files as in 9b.
10 pts #7 Write a full program to do this.
diff --git a/mod_10a/main.cpp b/mod_10a/main.cpp
index ba2906d..cde2050 100644
--- a/mod_10a/main.cpp
+++ b/mod_10a/main.cpp
@@ -1 +1,8 @@
-main
+#include "source.h"
+
+int main() {
+ getName();
+
+
+ return 0;
+}
diff --git a/mod_10a/source.cpp b/mod_10a/source.cpp
index 3070d67..442b001 100644
--- a/mod_10a/source.cpp
+++ b/mod_10a/source.cpp
@@ -1,2 +1,64 @@
-source.cpp
+// created by till-t
+// 2-nov-2021
+// cst 116
+
+
+#include "source.h"
+
+
+ // get input for name
+
+void getName() {
+ char first[100]{0};
+ char last[100]{0};
+ cout << "Please enter your first name: ";
+ cin >> first;
+
+ cout << "Please enter your last name: ";
+ cin >> last;
+
+ cout << first << ", " << last;
+
+
+}
+
+
+
+/*
+
+char first[100];
+ char last[100];
+ char fullName[100];
+
+ // void getFirst(char&)
+ printf("Enter your first name: ");
+ scanf("%s", first);
+ while(getchar() != '\n'); // remove new line char
+
+ printf("Enter your last name: ");
+ scanf("%s", last);
+ while(getchar() != '\n'); // remove new line char
+
+ first[0] = toupper(first[0]);
+ last[0] = toupper(last[0]);
+
+ // Now, concat first and last
+ int i = 0;
+ int j = 0;
+ while(last[j] != '\0') {
+ fullName[i++] = last[j++];
+ }
+ fullName[i++] = ',';
+ fullName[i++] = ' ';
+
+ j = 0;
+ while(first[j] != '\0') {
+ fullName[i++] = first[j++];
+ }
+ fullName[i] = '\0';
+
+ printf("First name: %s\n", first);
+ printf("Last name: %s\n", last);
+ printf("Full name: %s\n", fullName);
+*/
diff --git a/mod_10a/source.h b/mod_10a/source.h
index b9b18ba..023c433 100644
--- a/mod_10a/source.h
+++ b/mod_10a/source.h
@@ -1 +1,14 @@
-source file
+//
+//Created by Till on 2-Nov-21.
+//
+//
+
+
+#include <iostream>
+
+using namespace std;
+
+char first[100];
+char last[100];
+
+void getName();