subject

In this project, you will gain experience with many of the Python elements you’ve learned so far, including functions, decision structures, repetition structures ("loops"), Boolean logic, the random number module, accumulators, working with files, and exception handling. 2. PROBLEM DEFINITION Phase I. Your program will generate 50 random integers in the range of 0 – 10 (inclusive). Each number will be written to a separate line of an empty file. Name the file integer_list. txt. Close the file. Phase II. Next, open the file you just created and, within a loop, read each number. For each number, apply the processing rules given below. These rules specify how to change an accumulator that is initialized to zero before the processing begins. The three rules are: (a.) Integers occurring on odd-numbered lines will be added to the accumulator. (b.) Integers occurring on even-numbered lines will be divided by the preceding value (unless that number is 0, see rule "c".) using integer division (// not /), and the resulting integer will be added to the accumulator. (c.) When integers occurring on even-numbered lines have a preceding value of 0, your program will add the line number to the accumulator. Finally, output the value of the accumulator and then exit.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 10:00
Install and use wireshark program ( send back screen shots and other vital information) case project 3-2: decode a tcp segment in a wireshark capture in this chapter, you walked through tcp segment to interpret the data included in its header. in this project, you use wireshark to capture your own http messafes, examine the tcp headers, and practice interpreting the data you'll find there. 1. open wireshark and snap the window to one side of your screen. open a browser and snap that window to the other side of your screen so you can see both windows.
Answers: 2
question
Computers and Technology, 23.06.2019 19:00
This question involves a class named textfile that represents a text file. public class textfile { private string filename; private string filename; private arraylist words; // constructors not shown // postcondition: returns the number of bytes in this file public int filesize() { } // precondition: 0 < = index < words.size() // postcondition: removes numwords words from the words arraylist beginning at // index. public void deletewords(int index, int numwords) { } // precondition: 0 < = index < = words.size() // postcondition: adds elements from newwords array to words arraylist beginning // at index. pub lic voidaddwords(int index, string[] newwords) { } // other methods not shown } complete the filesize() method. the filesize() is computed in bytes. in a text file, each character in each word counts as one byte. in addition, there is a space in between each word in the words arraylist, and each of those spaces also counts as one byte. for example, suppose the words arraylist stores the following words: { mary had a little lamb; its fleece was white as snow. } the filesize() method would compute 4 + 3 + 1 + 6 + 5 + 4 + 6 + 3 + 5 + 2 + 5 as the sum of the lengths of each string in the arraylist. the value returned would be this sum plus 10, because there would also be 10 spaces in between the 11 words. complete the filesize() method below: // postcondition: returns the number of bytes in this file public int filesize() { }
Answers: 1
question
Computers and Technology, 23.06.2019 21:30
Which of the following includes the three primary network access technologies? dsl, cable modem, broadband lan, wan, man voip, uc, iptv tcp/ip, ftp, dhcp
Answers: 2
question
Computers and Technology, 24.06.2019 14:00
What are the different components of the cloud architecture?
Answers: 2
You know the right answer?
In this project, you will gain experience with many of the Python elements you’ve learned so far, in...
Questions
Questions on the website: 13722360