C++ Tutorial #6 — Nested if statements

Homework: C++ Homework 3: Using if statements to control program flow Topics Discussed: If statements, using bool(ean) operators as custom if-conditionals. #include using namespace std; int main() { double accountBalance = 5000.0, withdrawAmount = 0; cout > withdrawAmount; if (withdrawAmount > accountBalance) { cout 1000) { cout

Programming Challenge #1 — Primes

Code difficulty: 3/10 Math difficulty: 4/10 In this challenge I ask that you do the following things: Create a program that will: Allow a user to input a number Allow the user to see if the number is prime or not If the number is not prime, tell the user what number it is divisible... » read more

Programming Challenge #2 – Dual Primes

Code difficulty: 4/10 Math difficulty: 4/10 Before we begin here: Q. What is a dual prime? A. A dual prime is 2 prime numbers that are exactly “2” apart. Example: 3, 5 // 11,13, etc. In his challenge I ask that you do the following things: Create a program that will: Allow a user to... » read more