7 Topics

Member Avatar for
Member Avatar for Reverend Jim

Here's an interesting little scenario. You get challenged to a game of coin toss. Both players pick a sequence of coin toss results (heads or tails). The coin is repeatedly tossed until the sequence for one of the players occurs. The loser pays the winner a dollar. You'd assume that …

Member Avatar for xrjf
0
2K
Member Avatar for vegaseat

Again, calculate the minimum number of bills or coins required for a given amount of money (change). This time we will use a Go map instead of a csv string converted to a structure.

0
407
Member Avatar for vegaseat

This Go snippet calculates the minimum number of bills or coins needed for a given amount of money (change) requested. The program also gives the denomination and number. US curency is used in this example, but can be changed to another currency.

1
452
Member Avatar for Praveen_10

after the 1st iteration the toss is 100 and then the iteration increases toss to 200 and then 300. Why is this happening i want toss to be made only hundred times. PLease help me. #include <iostream> using namespace std; #include <cstdlib> #include<ctime> int toss(void); int main(void) { srand(time(0)); int …

Member Avatar for David W
0
377
Member Avatar for dustin.short.5

So I am taking C++ at thomas edison state college for a degree. I needed a computer course so I chose C++ instead of PLCs. The reason being is that I used to do some basic coding back in the apple IIe days. I apparently don't have the attention span …

Member Avatar for WaltP
0
318
Member Avatar for jeets1892

Please take a look at the below code #include <QtCore/QCoreApplication> #include <iostream> int main(int argc, char *argv[]) { using namespace std; double purchaseAmount; double paidAmount; float balance; int change, quarters, dimes, nickels, pennies, tenDollar, fiveDollar; // declare variables cout << "Enter Total purchased amount" << endl; cin >> purchaseAmount; cout …

Member Avatar for zeroliken
0
3K
Member Avatar for np complete

This is the famous counterfeit coin game in C++. # include <iostream> # include <cstring> # include <ctime> # include <cstdlib> # define coinVal 2; using namespace std; void gameInfo(); void generateGame(); void playGame(); int coins, counterfeitCoin; char typeOfCounterfeit; int main() { gameInfo(); generateGame(); } void gameInfo() { cout<<" Enter …

Member Avatar for np complete
0
796

The End.