4. One classic method for composing secret messages is called a square code. The spaces are...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
4. One classic method for composing secret messages is called a square code. The spaces are removed from the english text and the characters are written into a square (or rectangle). For example, the sentence "If man was meant to stay on the ground god would have given us roots" is 54 characters long, so it is written into a rectangle with 7 rows and 8 columns. ifmanwas meanttos tayonthe groundgo dwouldha vegivenu sroots The coded message is obtained by reading down the columns going left to right. For example, the message above is coded as: imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau In your program, have the user enter a message in english with no spaces between the words. Have the maximum message length be 81 characters. Display the encoded message. (Watch out that no "garbage" characters are printed.) Here are some more examples: Input haveaniceday feedthedog chillout Output hae and via ecy dd fto ehg ee clu hlt io 5. The results from the mayor's race have been reported by each precinct as follows: Precinct 1 2 3 4 5 Candidate A 192 147 186 114 267 Candidate Candidate Candidate B D 48 206 37 90 21 12 38 39 29 21 13 312 121 408 382 Write a program to do the following: a. Read the raw vote totals from a data file that contains one row for each precinct. b. Display the table with appropriate headings for the rows and columns. c. Compute and display the total number of votes received by each candidate and the percent of the total votes cast. d. If any one candidate received over 50% of the votes, the program should print a message declaring that candidate the winner. e. If no candidate received 50% of the votes, the program should print a message declaring a run-off between the two candidates receiving the highest number of votes; the two candidates should be identified by their letter names. f. For testing, run the program with the above data, and also with another data file where Candidate C receives only 108 votes in precinct 4. 4. One classic method for composing secret messages is called a square code. The spaces are removed from the english text and the characters are written into a square (or rectangle). For example, the sentence "If man was meant to stay on the ground god would have given us roots" is 54 characters long, so it is written into a rectangle with 7 rows and 8 columns. ifmanwas meanttos tayonthe groundgo dwouldha vegivenu sroots The coded message is obtained by reading down the columns going left to right. For example, the message above is coded as: imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau In your program, have the user enter a message in english with no spaces between the words. Have the maximum message length be 81 characters. Display the encoded message. (Watch out that no "garbage" characters are printed.) Here are some more examples: Input haveaniceday feedthedog chillout Output hae and via ecy dd fto ehg ee clu hlt io 4. One classic method for composing secret messages is called a square code. The spaces are removed from the english text and the characters are written into a square (or rectangle). For example, the sentence "If man was meant to stay on the ground god would have given us roots" is 54 characters long, so it is written into a rectangle with 7 rows and 8 columns. ifmanwas meanttos tayonthe groundgo dwouldha vegivenu sroots The coded message is obtained by reading down the columns going left to right. For example, the message above is coded as: imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau In your program, have the user enter a message in english with no spaces between the words. Have the maximum message length be 81 characters. Display the encoded message. (Watch out that no "garbage" characters are printed.) Here are some more examples: Input haveaniceday feedthedog chillout Output hae and via ecy dd fto ehg ee clu hlt io 4. One classic method for composing secret messages is called a square code. The spaces are removed from the english text and the characters are written into a square (or rectangle). For example, the sentence "If man was meant to stay on the ground god would have given us roots" is 54 characters long, so it is written into a rectangle with 7 rows and 8 columns. ifmanwas meanttos tayonthe groundgo dwouldha vegivenu sroots The coded message is obtained by reading down the columns going left to right. For example, the message above is coded as: imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau In your program, have the user enter a message in english with no spaces between the words. Have the maximum message length be 81 characters. Display the encoded message. (Watch out that no "garbage" characters are printed.) Here are some more examples: Input haveaniceday feedthedog chillout Output hae and via ecy dd fto ehg ee clu hlt io 4. One classic method for composing secret messages is called a square code. The spaces are removed from the english text and the characters are written into a square (or rectangle). For example, the sentence "If man was meant to stay on the ground god would have given us roots" is 54 characters long, so it is written into a rectangle with 7 rows and 8 columns. ifmanwas meanttos tayonthe groundgo dwouldha vegivenu sroots The coded message is obtained by reading down the columns going left to right. For example, the message above is coded as: imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau In your program, have the user enter a message in english with no spaces between the words. Have the maximum message length be 81 characters. Display the encoded message. (Watch out that no "garbage" characters are printed.) Here are some more examples: Input haveaniceday feedthedog chillout Output hae and via ecy dd fto ehg ee clu hlt io 4. One classic method for composing secret messages is called a square code. The spaces are removed from the english text and the characters are written into a square (or rectangle). For example, the sentence "If man was meant to stay on the ground god would have given us roots" is 54 characters long, so it is written into a rectangle with 7 rows and 8 columns. ifmanwas meanttos tayonthe groundgo dwouldha vegivenu sroots The coded message is obtained by reading down the columns going left to right. For example, the message above is coded as: imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau In your program, have the user enter a message in english with no spaces between the words. Have the maximum message length be 81 characters. Display the encoded message. (Watch out that no "garbage" characters are printed.) Here are some more examples: Input haveaniceday feedthedog chillout Output hae and via ecy dd fto ehg ee clu hlt io 5. The results from the mayor's race have been reported by each precinct as follows: Precinct 1 2 3 4 5 Candidate A 192 147 186 114 267 Candidate Candidate Candidate B D 48 206 37 90 21 12 38 39 29 21 13 312 121 408 382 Write a program to do the following: a. Read the raw vote totals from a data file that contains one row for each precinct. b. Display the table with appropriate headings for the rows and columns. c. Compute and display the total number of votes received by each candidate and the percent of the total votes cast. d. If any one candidate received over 50% of the votes, the program should print a message declaring that candidate the winner. e. If no candidate received 50% of the votes, the program should print a message declaring a run-off between the two candidates receiving the highest number of votes; the two candidates should be identified by their letter names. f. For testing, run the program with the above data, and also with another data file where Candidate C receives only 108 votes in precinct 4. 5. The results from the mayor's race have been reported by each precinct as follows: Precinct 1 2 3 4 5 Candidate A 192 147 186 114 267 Candidate Candidate Candidate B D 48 206 37 90 21 12 38 39 29 21 13 312 121 408 382 Write a program to do the following: a. Read the raw vote totals from a data file that contains one row for each precinct. b. Display the table with appropriate headings for the rows and columns. c. Compute and display the total number of votes received by each candidate and the percent of the total votes cast. d. If any one candidate received over 50% of the votes, the program should print a message declaring that candidate the winner. e. If no candidate received 50% of the votes, the program should print a message declaring a run-off between the two candidates receiving the highest number of votes; the two candidates should be identified by their letter names. f. For testing, run the program with the above data, and also with another data file where Candidate C receives only 108 votes in precinct 4. 5. The results from the mayor's race have been reported by each precinct as follows: Precinct 1 2 3 4 5 Candidate A 192 147 186 114 267 Candidate Candidate Candidate B D 48 206 37 90 21 12 38 39 29 21 13 312 121 408 382 Write a program to do the following: a. Read the raw vote totals from a data file that contains one row for each precinct. b. Display the table with appropriate headings for the rows and columns. c. Compute and display the total number of votes received by each candidate and the percent of the total votes cast. d. If any one candidate received over 50% of the votes, the program should print a message declaring that candidate the winner. e. If no candidate received 50% of the votes, the program should print a message declaring a run-off between the two candidates receiving the highest number of votes; the two candidates should be identified by their letter names. f. For testing, run the program with the above data, and also with another data file where Candidate C receives only 108 votes in precinct 4. 5. The results from the mayor's race have been reported by each precinct as follows: Precinct 1 2 3 4 5 Candidate A 192 147 186 114 267 Candidate Candidate Candidate B D 48 206 37 90 21 12 38 39 29 21 13 312 121 408 382 Write a program to do the following: a. Read the raw vote totals from a data file that contains one row for each precinct. b. Display the table with appropriate headings for the rows and columns. c. Compute and display the total number of votes received by each candidate and the percent of the total votes cast. d. If any one candidate received over 50% of the votes, the program should print a message declaring that candidate the winner. e. If no candidate received 50% of the votes, the program should print a message declaring a run-off between the two candidates receiving the highest number of votes; the two candidates should be identified by their letter names. f. For testing, run the program with the above data, and also with another data file where Candidate C receives only 108 votes in precinct 4. 5. The results from the mayor's race have been reported by each precinct as follows: Precinct 1 2 3 4 5 Candidate A 192 147 186 114 267 Candidate Candidate Candidate B D 48 206 37 90 21 12 38 39 29 21 13 312 121 408 382 Write a program to do the following: a. Read the raw vote totals from a data file that contains one row for each precinct. b. Display the table with appropriate headings for the rows and columns. c. Compute and display the total number of votes received by each candidate and the percent of the total votes cast. d. If any one candidate received over 50% of the votes, the program should print a message declaring that candidate the winner. e. If no candidate received 50% of the votes, the program should print a message declaring a run-off between the two candidates receiving the highest number of votes; the two candidates should be identified by their letter names. f. For testing, run the program with the above data, and also with another data file where Candidate C receives only 108 votes in precinct 4.
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
What does 'buying local' mean to you? How do you determine what 'local' means? Are there limits to buying local here in PEI? Is buying local a priority for you when making purchases? How do you...
-
Barclay Systems' revenues for 2016 totaled $26.2 million. As with most companies, Barclay is a defendant in lawsuits related to its products. Note 14 of the Barclay annual report for 2016 reported...
-
Sam and Sally want to invest $500,000 in new restaurant. They need to achieve a 10% Return on that investment annually. The restaurant has fixed costs of $5,000 per month. Their estimated variable...
-
How to draft a complaint?
-
Ross Corporation is a debtor in a reorganization proceeding under Chapter 11 of the Bankruptcy Code. By fair and proper valuation, its assets are worth $100,000. The indebtedness of the corporation...
-
Assume that Paradise Peach Hotel, a hotel chain, is planning to open its hotel in a new location. It is assumed that the project will produce net cash inflows of $1,000,000 at the end of each of the...
-
Ben Derby is a highly paid scout for a professional baseball team. He attends at least five or six Major League Baseball games a week and watches as many recorded games as he can in order to evaluate...
-
Estimate the value of integral subscript 2 superscript 4 fraction numerator 1 5 over denominator x squared plus 1 end fraction d x by using n equals 4 subintervals of equal width using Simpson s...
-
Find f'(x) for f(x) = 10 In(10) f'(x)=help (formulas)
-
Lucia Company has set the following standard cost per unit for direct materials and direct labor. Direct materials (15 pounds $4 per pound) Direct labor (3 hours @ $15 per hour) $ 60 45 During May...
-
Barnes Company reports the following for its product for its first year of operations. Direct materials. Direct labor Variable overhead. Fixed overhead Variable selling and administrative expenses...
-
How does the use of non-linear narrative structure in novels like "One Hundred Years of Solitude" by Gabriel Garca Mrquez or "Cloud Atlas" by David Mitchell contribute to the complexity and depth of...
-
Find the first partial derivatives of the function. fx(x, y) = = fy(x, y) = f(x, y) = = [* cos(t7) dt
-
3. a. What is feasibility study and why do we need it in a software development process? [5 marks] b. List and explain the processes in a software risk management c. Explain briefly Information...
-
The bookkeeper for Riley, Inc., made the following errors: a. A cash purchase of supplies of $357 was recorded as a debit to Supplies for $375 and a credit to Cash of $375. b. A cash sale of $3,154...
-
For the PD control system shown in Figure 10.7.1, I = c = 2. Compute the values of the gains Kp and KD to meet all of the following specifications: 1. No steady-state error with a step input 2. A...
-
With the PI gains set to Kp = 6 and K1 = 50 for the plant Gp (s) = 1 / s + 4 The time constant is ( = 0.2 and the damping ratio is ( = 0.707. Suppose there is a rate limiter of 0.1 between the...
-
Consider the PD control system shown in Figure 10.7.1. Suppose that I = 20 and c = 10. The specifications require the steady-state error due to a unit-step command to be zero and the steady-state...
-
Solve Problem 8.73 using the Rayleigh-Ritz method with the mode shape \[U(x)=c_{1} \sin \frac{\pi x}{2 l}+c_{2} \sin \frac{3 \pi x}{2 l}\]
-
Using Program \(12 . \mathrm{m}\), solve Example 8.4. Data From Example 8.4:- Find the natural frequencies of a bar with one end fixed and a mass attached at the other end, as in Fig. 8.9.
-
Using MATLAB, plot the dynamic response of the plucked string, Eq. (E.6) of Example 8.1, at \(x=l / 2\). Data: \(h=0.1 \mathrm{~m}, l=1.0 \mathrm{~m}, c=100 \mathrm{~m} / \mathrm{s}\). Data From...
Study smarter with the SolutionInn App