You must complete this without talking or chatting or emailing or contacting or asking for help from other people. You may not use AI tools. You may use your books, labs, or resources on your computer etc. You may not use online resources (unless you are using your book or look up the slides). Everything you do must be on your computer’s screen (so no phones). Programming Final 100 points. In this final, you will be manipulating a grid. You may assume the user will enter correct input (unless noted). Read data that makes up a grid from a file The file must be named test.txt First two numbers in the file are the sizes of grid. The first number is the X size (so how many spots across), the second value is the Y size (how many spots down). After the sizes, the rest of the file is filled with data to fill in the grid. Example file: 3 4X Y YA B CD E FH F A Print out the contents in a grid. For the example file, the output should be X Y YA B CD E FH F A NOTE: Your array might be transposed once you print out the data. If you cannot figure it out quickly why that is, continue on and come back. A transposed print is worth a lot less than the rest of the exam. Repeatedly loop over a menu. Options in the menu: Update all the values in a row with a particular value The user enters in the row number and a value and all entries in that row are set to the value. Query a value if given the indexes. Here the user inputs an X and Y and you print out the value present at the spot. You must account for if the user does not enter a valid X or valid Y – send the user back to the menu if it is invalid. Print the grid. Print out whether a particular value is in the grid Here the user enters in a VALUE and you tell them if it exists in the grid. If anything else is entered then the program exits. Example run (using the previous example input file. NOTE: the test file can be different.) X Y Y A B C D E F H F A 1. Set all the values in a row an entered value2. Get the value at an index3. Print the grid4. Determine if in gridAny other input exits.Please enter an option: >> 1Which row?>> 1What value?>> 41. Set all the values in a row an entered value2. Get the value at an index3. Print the grid4. Determine if in gridAny other input exits.Please enter an option: >> 3X Y Y 4 4 4 D E F H F A 1. Set all the values in a row an entered value2. Get the value at an index3. Print the grid4. Determine if in gridAny other input exits.Please enter an option: >> 2Please enter in an x and y>> 0 1Value is: 41. Set all the values in a row an entered value2. Get the value at an index3. Print the grid4. Determine if in gridAny other input exits.Please enter an option: >> 4What value do you wish to check?>> AA exists1. Set all the values in a row an entered value2. Get the value at an index3. Print the grid4. Determine if in gridAny other input exits.Please enter an option: >> quit
Blog
CHM341-EXAM_5-Sp25.pdf
CHM341-EXAM_5-Sp25.pdf
CHM341-EXAM_4-Sp25.pdf
CHM341-EXAM_4-Sp25.pdf
In chapter 12 we learned about psychological disorders. Duri…
In chapter 12 we learned about psychological disorders. During the in-person Wednesday class, we watched a video interview of a person with schizophrenia. What was noteworthy about the person’s hands?
When studying chapter 8 on memory, the in-class participatio…
When studying chapter 8 on memory, the in-class participation activity completed in class
Recent research has revealed a sixth factor that has been ad…
Recent research has revealed a sixth factor that has been added to the five factor model of personality. What is the sixth factor?
A chef in a restaurant that specializes in pasta dishes was…
A chef in a restaurant that specializes in pasta dishes was having trouble with getting brands of pasta to be al dente – that is, cooked enough so as not to feel starchy or hard but still feel firm when bitten into. She decided to conduct an experiment in which two brands of pasta, one American and one Italian, were cooked for either 4 or 8 minutes. The uncooked pasta was added and then weighed after a given period of time by lifting the pasta from the pot via a built-in strainer. The data (in terms of weight in grams) is here: Four Eight American 265 310 270 320 Italian 250 300 245 305 And partial two-way ANOVA results (a = 0.05) are below: ANOVA Source of Variation SS df MS F P-value F crit Sample 528.125 1 528.125 24.14286 0.007966 7.708647 Columns 5253.125 1 5253.125 240.1429 0.000101 7.708647 Interaction 28.125 1 28.125 1.285714 0.320188 7.708647 Within 87.5 4 21.875 Total 5896.875 7 According to the results, what do we determine about the cooking time?
Consider the following table, which shows revenue of the lar…
Consider the following table, which shows revenue of the largest manufacturer of chewing gum, Wrigley Company (partially filled): Year Revenue SMA(5) WMA(3) EWMAλ=0.1{“version”:”1.1″,”math”:”λ=0.1″} 1984 591 #N/A 1985 620 1986 699 C 1987 781 A 1988 891 B 1989 993 If we use 1/2 for the most recent value, 1/3 for the second-most recent value, and 1/6 for the oldest value, then the value of B in the table above is:
Let the regression equation be given by yL=78-32x{“version”:…
Let the regression equation be given by yL=78-32x{“version”:”1.1″,”math”:”yL=78-32x”}, where x{“version”:”1.1″,”math”:”x”} represents the number of hours spent partying and yL{“version”:”1.1″,”math”:”yL”} represents the predicted grade on the final exam. What is the appropriate interpretation of the slope in this scenario?
We develop a regression model to predict the assessed value…
We develop a regression model to predict the assessed value of houses, using the size of the houses (in square feet) and the age of the houses (in years). Below, we observe partial results of running a multiple regression: Multiple R 0.909120107 R Square 0.826499369 Adjusted R Square 0.797582598 Standard Error 2168.165527 Observations 15 ANOVA df SS MS F Regression 2 268724699 134362349.5 28.58200688 Residual 12 56411301.01 4700941.751 Total 14 325136000 Coefficients Standard Error t Stat P-value Upper 95% Lower 95.0% Intercept 163775.1236 5407.173152 30.28849253 1.05104E-12 175556.3418 151993.9054 Size 10.72518298 3.014327189 3.558068619 0.003937797 17.29283773 4.157528235 Age -284.254348 83.59835914 -3.400238365 0.005267391 -102.1091708 -466.3995252 The multiple regression equation is: