Sample Program

 

Nonstructured Computation

The following covers code samples of nonstructrued computations. Each sample includes four parts – the problem, the tip, the code, and the result.

Calculate Prime Numbers with Sieve Method
Fibonacci Sequence
Repetend
Simulate Multiple Recursion
Dealing Cards
Word Appearance Frequency
Perpetual Calendar
Eight Queens Puzzle
24-Point Game
Inspect Checksum of Barcode (#60)

Database Computation

The following covers code samples of database computations. Each sample includes four parts – the problem, the tip, the code, and the result.

Play Matchmaker
Freightage Computation
Generate the Text Histogram
Make the Management Tree
Top N Clients Accounting for Half of the Total Sales in a Certain Year
Stocks Hitting Their Daily Limits for 3 Consecutive Days in a Month
Count the Married Couples Whose Total Age is Over 70 Inclusive
Employees Who Have Worked in New York for over 5 Years Cumulatively
Commodities with the Longest Accumulated Out-of-Stock Time in a Month
Average Residence Time of Certain Types of Commodities in the Supermarket before Being Sold Out
Salesperson Achieving the Highest Sales Values during Promotion
Customers who Ordered All Types of Products
Employees Who Have Taken a Leave Longer Than 2 Consecutive Days Three Times in a Year
Prepare Test Data for Sales Management System
Tabulate Olympic Games Medal Standings
Compute Salary Payable based on Attendance and Performance Data
Present Data in Multi-Column Report Layout
Find the Consecutive Vacant Seats in a Restaurant
Calculate User Growth Rate under Recurring Charge Mode
Calculate Client Churn Rate