From b68058e1718f0ca4a4bbc26ae09cc3452466dca5 Mon Sep 17 00:00:00 2001 From: brodriguez8774 <brodriguez8774@gmail.com> Date: Thu, 23 Jan 2020 00:55:44 -0500 Subject: [PATCH] Implement "Problem 1" --- documents/references.md | 3 ++ main.c | 92 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 94 insertions(+), 1 deletion(-) diff --git a/documents/references.md b/documents/references.md index 0b685f8..78c3014 100644 --- a/documents/references.md +++ b/documents/references.md @@ -7,6 +7,9 @@ Includes anything from stack overflow links to notes about logic from previous w ## References +### Specifying Decimal Places to Print Out +<https://stackoverflow.com/a/12761583> + ### All Printf Format Types <https://www.tutorialspoint.com/c_standard_library/c_function_printf.htm> diff --git a/main.c b/main.c index 6c8b577..fd2075d 100644 --- a/main.c +++ b/main.c @@ -18,6 +18,11 @@ // Method Declaration. +void problem_1(); +void problem_2(); +void problem_3(); +void problem_4(); +void problem_5(); /** @@ -27,5 +32,90 @@ int main(int argc, char* argv[]) { printf("Starting program.\n"); - printf("Terminating program.\n"); + problem_1(); + problem_2(); + problem_3(); + problem_4(); + problem_5(); + + printf("\n\nTerminating program.\n"); +} + + +/** + * Problem 1 + * + * Declares a float of 2.5. + * Then prints to ten decimal places. + */ +void problem_1() { + printf("\n\nProblem 1 start.\n\n"); + printf("Expected Output:\n"); + printf("2.5000000000\n"); + printf("Actual Output:\n"); + + float test_float = 2.5; + printf("%.10lf\n", test_float); + + printf("\nProblem 1 end.\n"); +} + + +/** + * Problem 2 + * + * + */ +void problem_2() { + printf("\n\nProblem 2 start.\n\n"); + printf("Expected Output:\n"); + printf("\n"); + printf("Actual Output:\n"); + + printf("\nProblem 2 end.\n"); +} + + +/** + * Problem 3 + * + * + */ +void problem_3() { + printf("\n\nProblem 3 start.\n\n"); + printf("Expected Output:\n"); + printf("\n"); + printf("Actual Output:\n"); + + printf("\nProblem 3 end.\n"); +} + + +/** + * Problem 4 + * + * + */ +void problem_4() { + printf("\n\nProblem 4 start.\n\n"); + printf("Expected Output:\n"); + printf("\n"); + printf("Actual Output:\n"); + + printf("\nProblem 4 end.\n"); +} + + +/** + * Problem 5 + * + * + */ +void problem_5() { + printf("\n\nProblem 5 start.\n\n"); + printf("Expected Output:\n"); + printf("\n"); + printf("Actual Output:\n"); + + printf("\nProblem 5 end.\n"); } -- GitLab