StaffCoder
C+
C++C++
6 modules · 26 challengesSign up
Module 2 of 6 · 4 challenges

C++ Control Flow & Loops

Learn how to pick results with if/else chains and switch, repeat work with while, for and do loops, stop a search early with break, continue and early returns, and simulate a loan payoff month by month.
Finish every challenge, or complete the star challenge, to complete the module.

Challenges

4 challenges

Fee Tier Rules

Sign up to unlock
—No data yeteasy
About this challenge

Write the loan tool's pricing rules with if/else chains and a switch: late fee bands, credit tier codes and payment method fees.

Solved in a browser IDE and graded by tests. Sign up to solve

Savings Goal Loops

Sign up to unlock
—No data yeteasy
About this challenge

Write the savings planner's loops: a while loop to a goal, a for loop that skips fee-free days, a review loop that always runs once, and a search for the first overdraft month.

Solved in a browser IDE and graded by tests. Sign up to solve

Payoff Search

Sign up to unlock
—No data yeteasy
About this challenge

Simulate a loan month by month and search for the smallest payment that clears it within a term, using early returns from nested loops.

Solved in a browser IDE and graded by tests. Sign up to solve

Loan Payoff Simulator

STAR
Solving it completes the module
—No data yeteasy
About this challenge

Simulate a customer's loan from a credit score: pick the tier rate, run the monthly schedule with skipped payments, total what is paid, and search for the payment that clears the loan in time.

Solved in a browser IDE and graded by tests. Sign up to solve

We use cookies that are necessary to run Staffcoder, and optional analytics cookies to see which pages get used. Analytics stays off unless you accept. Read our Cookie Policy.