Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C please. Not C++ or Java In C please. Not C++ or Java Given numRows and numColumns, print a list of all seats in

In C please. Not C++ or Java

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

In C please. Not C++ or Java

Given numRows and numColumns, print a list of all seats in a theater. Rows are numbered, columns lettered, as in 1A or 3E. Print a space after each seat, including after the last. Ex: num Rows = 2 and numColumns = 3 prints: 1A 1B 1C 2A 2B 2C 1 test passed 1 #include 2 3 int main(void) { 4 int numrows; 5 int numColumns; 6 b int currentRow; 2 int currentColumn; . char currentColumnLetter; All tests passed scanf("%d", &numRows); scanf("%d", &numColumns); 10 10 11. 11 12 13 14. \* Your solution goes here */ printf(" "); 15 16 17 18 } return 0; Run View your last submission Feedback? "Simon Says" is a memory game where "Simon" outputs a sequence of 10 characters (R, G, B, Y) and the user must repeat the sequence. Create a for loop that compares the two strings starting from index 0. For each match, add one point to userScore. Upon a mismatch, exit the loop using a break statement. Assume simonPattern and user Pattern are always the same length. Ex: The following patterns yield a user Score of 4: simonPattern: RRGBRYYBGY user Pattern: RRGBBRYBGY 1 #include 2 #include 1 test passed 4 int main(void) { char simonPattern[50]; char userPattern[50]; int userScore; int i; All tests passed userScore = 0; scanf("%s", simonPattern); scanf("%s", userPattern); 10 11 12 13 14 15 16 17 18 /* Your solution goes here */ printf("userScore: %d ", userScore); Run Feedback? CHALLENGE ACTIVITY 4.10.1: Basic do-while loop with user input. Complete the do-while loop to output from 0 to the value of countLimit using printVal. Assume the user will only input a positive number For example, if countLimit is 5 the output will be 0 1 2 3 4 5 1 #include 1 test passed 3 int main(void) { 4 int countLimit; 5 int printval; D!loli All tests passed 7 8 // Get user input scanf("%d", &countLimit); 10 11 12 13 14 15 16 17 18 } printVal = 0; do { printf("%d ", printVal); printval = printval + 1; } while (* Your solution goes here *); printf(" "); return 0; Run Feedback? Write a do-while loop that continues to prompt a user to enter a number less than 100, until the entered number is actually less than 100. End each prompt with newline. Ex: For the user input 123, 395, 25, the expected output is: Enter a number ( 1 test passed 3 int main(void) { int user Input; \* Your solution goes here */ All tests passed printf("Your number 2 3 int main(void) { 4 enum GroceryItem {GR_APPLES, GR_BANANAS, GR_JUICE, GR_WATER}; 5 enum GroceryItem userItem; 6 userItem = GR_APPLES; All tests passed \* Your solution goes here */ 9 10 11 12 } return 0; Run Feedback? Complete the code provided to add the appropriate amount to totalDeposit. 1 test passed on A All tests passed 1 #include 2 3 int main(void) { 4 enum AcceptedCoins {ADD_QUARTER, ADD_DIME, ADD_NICKEL, ADD_UNKNOWN}; 5 int totalDeposit = 0; 6 int user Input; 7 8 printf("Add coin: 0 (add 25), 1 (add 10), 2 (add 5). "); 9 scanf("%d", &userInput); 10 11 if (user Input == ADD_QUARTER) { 12 totalDeposit = totalDeposit + 25; 13 } 14 15 \* Your solution goes here */ 16 17 else { 18 printf("Invalid coin selection. "); Run Feedback

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions