(Game: connect four) Connect four is a two-player board game in which the players alternately drop colored disks into a seven-column, six-row verticallysuspended grid
Tue Jan 12 2021 19:28:43 GMT+0000 (UTC)#c++
(Pattern recognition: consecutive four equal numbers) Write the following function that tests whether a two-dimensional array has four consecutive numbers of the same value, either horizontally, vertically, or diagonally.
Tue Jan 12 2021 09:58:35 GMT+0000 (UTC)#c++
Fri Jan 08 2021 09:33:32 GMT+0000 (UTC)#c++
Sun Dec 20 2020 11:27:54 GMT+0000 (UTC)#c++
(Count occurrence of numbers) Write a program that reads at most 100 integers between 1 and 100 and counts the occurrence of each number. Assume the input ends with 0. Here is a sample run of the program:
Fri Dec 11 2020 21:08:00 GMT+0000 (UTC)#c++
Fri Dec 11 2020 20:09:09 GMT+0000 (UTC)#c++
Wed Nov 25 2020 01:54:07 GMT+0000 (UTC)#c++
Sun Nov 15 2020 20:41:49 GMT+0000 (UTC)#c++
Write a test program that prompts the user to enter a number and its width and displays a string returned by invoking format(number, width).
Fri Nov 13 2020 07:38:03 GMT+0000 (UTC)#c++
(Average of even places)Write a function that returns the average of the digits in the even places in an integer using the following header: double avgOfEvenPlaces(int n)
Wed Nov 11 2020 05:55:19 GMT+0000 (UTC)#c++
Write a program that finds the first 25 additive prime numbers and displays the output in the following format:
Tue Nov 10 2020 16:35:52 GMT+0000 (UTC)#c++
Tue Nov 10 2020 16:12:46 GMT+0000 (UTC)#c++
Mon Nov 09 2020 01:01:29 GMT+0000 (UTC)#c++
(Financial application: find the profit-per-item) Use the scheme in programming Exercise 5.39 to write a function that computes the profit-per-item. The header of the function is: double computeProfitPerItem(double quantity) Write a test program that displays the following table:
Sun Nov 08 2020 00:51:22 GMT+0000 (UTC)#c++
Fri Nov 06 2020 03:45:15 GMT+0000 (UTC)#c++
Thu Nov 05 2020 20:47:39 GMT+0000 (UTC)#c++
: Converting Decimals to Hexadecimals,” gives a program that converts a decimal to a hexadecimal. How do you convert a hex number into a decimal?
Sun Nov 01 2020 20:05:47 GMT+0000 (UTC)#c++
(Occurrence of max numbers) Write a program that reads integers, finds the largest of them, and counts its occurrences. Assume that the input ends with number 0. Suppose that you entered 3 5 2 5 5 5 0; the program finds that the largest is 5 and the occurrence count for 5 is 4
Wed Oct 28 2020 20:25:40 GMT+0000 (UTC)#c++
You have just started a new stationary shop. Your profit-per-item depends on the total quantity of item sold. Hide Copy Code Your profit-per-item depends on the total quantity of item sold. The scheme shown below is used to determine the total profit: Quantity Profit-per-item 0–1000 $1 1001–5000 $2 5001 and above $5 Save Note that this is a graduated profit. The profit for selling up to 1000 items is $1, for next 4000 items is $2 and beyond that is $5. If the total quantity of item sold is 10000, the profit is 1000 * $1 + 4000 * $2 + 5000 * $5 = $34000. Your goal is to make $50,000 a year. Write a program that uses a do-while loop to find out the minimum quantity of item you have to sell in order to make $50,000
Wed Oct 28 2020 10:55:45 GMT+0000 (UTC)#c++
(Palindrome number) Write a program that prompts the user to enter an integer and uses loops to simplify Programming Exercise 3.36.
Tue Oct 27 2020 08:04:05 GMT+0000 (UTC)#c++
(Fibonacci Series) The Fibonacci series is a series that begins with 0 and 1 and has the property that each succeeding term is the sum of the two preceding terms. For example, the third Fibonacci number is 1 which is sum of 0 and 1. The next is 2, which is a sum of 1 + 1. Write a program that displays the first ten numbers in a Fibonacci series
Tue Oct 27 2020 06:00:36 GMT+0000 (UTC)#c++
(Display calendars) Write a program that prompts the user to enter the year and first day of the year and displays the calendar table for the year on the console. For example, if the user entered the year 2013 and 2 for Tuesday, January 1, 2013, your program should display the calendar for each month in the year, as follows:
Mon Oct 26 2020 11:49:54 GMT+0000 (UTC)#c++
(Display the Sundays in a month) Write a program that prompts the user to enter the month and first day of the month, and displays all the Sundays in that month. For example, if the user entered the month 7 for July, and the first day 4 for Wednesday, your program should display the following output: The first day of this month is Wednesday! ... Next Sunday of this month is on 26
Mon Oct 26 2020 10:26:16 GMT+0000 (UTC)#c++
**5.21 (Display numbers in a pyramid pattern) Write a nested for loop that prints the following output:
Sat Oct 24 2020 17:58:24 GMT+0000 (UTC)#c++
9 (Display pyramid) Write a program that prompts the user to enter an integer from 1 to 15 and displays a pyramid, as shown in the following sample run
Sat Oct 24 2020 03:24:57 GMT+0000 (UTC)#c++
(Display the ASCII character table) Write a program that prints all the uppercase characters of the ASCII character table. Display 5 characters per line. The ASCII table is shown in Appendix B. Characters are separated by exactly one space.
Sat Oct 24 2020 02:47:16 GMT+0000 (UTC)#c++
(Compute the greatest common divisor) Another solution for Listing 5.10 to find the greatest common divisor (GCD) of two integers n1 and n2 is as follows: First find d to be the minimum of n1 and n2, then check whether d, d-1, d-2, . . . , 2, or 1 is a divisor for both n1 and n2 in this order. The first such common divisor is the greatest common divisor for n1 and n2. Write a program that prompts the user to enter two positive integers and displays the GCD.
Sat Oct 24 2020 02:37:47 GMT+0000 (UTC)#c++
(Find the largest n such that 2n < 30,000)) Use a while loop to find the largest integer n such that 2n is less than 30,000.
Sat Oct 24 2020 01:37:34 GMT+0000 (UTC)#c++
(Find numbers divisible by 3 or 6, but not both) Write a program that displays all the numbers from 300 to 400, 5 per line, that are divisible by 3 or 6, but not both. Numbers are separated by exactly one space.
Fri Oct 23 2020 07:14:14 GMT+0000 (UTC)#c++
Fri Sep 11 2020 14:28:11 GMT+0000 (UTC)#c++