Posts

Showing posts with the label language

C: Convert cm or inches (no functions).

Image
Demonstration of converting cm or inches without using functions. Repl: https://replit.com/@pereiradaniel/Convert-cm-to-inches-function Git repo: https://github.com/pereiradaniel/c_programs/blob/master/metric_imperial_conv/conv2_alt.c  

C: Convert cm and inches using functions.

Image
Demonstration of using functions to convert cm and inches with a main program loop. Some constraints applied to protect against incorrect inputs. Uses a goto statement to emergency exit on wrong input. Repl: https://replit.com/@pereiradaniel/Convert-cm-or-inches-functions Git repo: https://github.com/pereiradaniel/c_programs/blob/master/metric_imperial_conv/conv2.c  

C: Convert cm to inches (no function).

Image
Simple program demonstrating conversion of cm to inches without implementing a function. This is simpler, but your ideal implementation may depend upon a variety of factors requiring your careful consideration. Repl: https://replit.com/@pereiradaniel/Convert-cm-to-inches-no-function Git repo: https://github.com/pereiradaniel/c_programs/blob/master/metric_imperial_conv/conv_alt.c  

C: Convert cm to inches using a function.

Image
Simple program demonstrating one way to convert cm to inches and display the result to the user. Repl: https://replit.com/@pereiradaniel/Convert-cm-to-inches-function Git repo: https://github.com/pereiradaniel/c_programs/blob/master/metric_imperial_conv/conv.c  

C: Decimal/Binary Converter.

Image
A program that converts decimal and binary numbers. Repl: https://replit.com/@pereiradaniel/Dual-BinaryDecimal-Converter Git repo: https://github.com/pereiradaniel/c_programs/blob/master/bin_dec_conv/dual_conversion/dual_conv.c  

C: Decimal to binary conversion with non-recursive function.

Image
Convert a decimal number to binary using a non-recursive function. Repl: https://replit.com/@pereiradaniel/Decimal-to-binary-non-recursive Git repo:  https://github.com/pereiradaniel/c_programs/blob/master/bin_dec_conv/non_recursive/bin_dec_conv.c  

C: Decimal to binary conversion using a recursive function.

Image
Recursive method of decimal to binary conversion. Repl: https://replit.com/@pereiradaniel/Decimal-to-binary-recursive Git repo: https://github.com/pereiradaniel/c_programs/tree/master/bin_dec_conv/recursive  

C: Modify calculator to catch divide by zero error.

Image
Calculator now catches divide by zero error by testing to see if either user inputs are equal to 0, otherwise it executes the division. Repl: https://replit.com/@pereiradaniel/Calculator-Exponent-function-added Git repo: https://github.com/pereiradaniel/c_programs/blob/master/calc/calc4.c  

C: Calculator with exponent function.

Image
Added exponent function to calculator, with improved messages for user. Repl: https://replit.com/@pereiradaniel/Calculator-Exponent-function-added Git repo: https://github.com/pereiradaniel/c_programs/blob/master/calc/calc3.c  

C: Calculator with main loop repeat.

Image
Calculator program now loops until user quits. Repl: https://replit.com/@pereiradaniel/Calculator-Main-loop-added Git repo: https://github.com/pereiradaniel/c_programs/blob/master/calc/calc2.c  

C: Basic calculator program.

Image
Basic calculator program for possible future improvements. Repl: https://replit.com/@pereiradaniel/Calculator-program Git repo: https://github.com/pereiradaniel/c_programs/blob/master/calc/calc.c  

C: Exercise 4-3 improved by splitting ascending/descending loop into two...

Image
Improvement to exercise 4-3 using a different type of switchable for loop, with compiler examination.  Repl: https://replit.com/@pereiradaniel/Improved-asc-desc-for-loop-added-to-existing-project Git repo: https://github.com/pereiradaniel/beginning_c/blob/master/ch4/exercises/4_3/refactor5.c  

C: Improve exercise 4-3 with improved ascending/descending for loop.

Image
Improvement to exercise 4-3 using a different type of switchable for loop, with compiler examination.  Repl: https://replit.com/@pereiradaniel/Improved-asc-desc-for-loop-added-to-existing-project Git repo: https://github.com/pereiradaniel/beginning_c/blob/master/ch4/exercises/4_3/refactor5.c  

C: Improved ascending and descending for loop.

Image
Improved ascending and descending for loop with alternate example and compilation comparison. Repl: https://replit.com/@pereiradaniel/Exercise-4-3-refactor-4 Git repo: https://github.com/pereiradaniel/c_programs/blob/master/asc_desc_for/asc_desc_for2.c  

C: Ascending or descending for loop.

Image
A for loop that can run forward or backward. Repl: https://replit.com/@pereiradaniel/Ascending-or-descending-for-loop Git repo: https://github.com/pereiradaniel/c_programs/blob/master/asc_desc_for/asc_desc_for.c  

C: Exercise 4-3, sort by ascending or descending order.

Image
Added sorting by ascending or descending order. Repl: https://replit.com/@pereiradaniel/Exercise-4-3-refactor-4 Git repo: https://github.com/pereiradaniel/beginning_c/blob/master/ch4/exercises/4_3/refactor4.c

C: Exercise 4-3 improvements of refactor 3.

Image
Improvement of this program: https://youtu.be/1_ER9Gzsglw Repl: https://replit.com/@pereiradaniel/Exercise-4-3-refactor-3 Git repo (this project):  https://github.com/pereiradaniel/Exercise-4-3-refactor-3 Git repo (archive of projects):  https://github.com/pereiradaniel/beginning_c  

repl: Exercise 4-3, refactor 3.

 

C: Character code printout with main loop repeat.

Image
Refactored version of previous program: https://youtu.be/fYuV8NQ1ieo Program loops until user quits. Git repo: https://github.com/pereiradaniel/beginning_c/blob/master/ch4/exercises/4_3/refactor2.c

C: Print character codes in a table.

Image
A program that will output the printable characters for character code values from 0 to 127. Each character code is printed along with its symbol. Make sure the columns are aligned. UPGRADES to original exericse!      - User selects between 1-8 columns to display.      - CHAR_MAX to control upper limit of char codes. Git repo: https://github.com/pereiradaniel/beginning_c/blob/master/ch4/exercises/4_2/exercise4_2.c