Consider the following python program and write the output str=computer networks print(str.find('k')) print(str.count('e')) print(len (str)) print(str.replace('computer',...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Consider the following python program and write the output str="computer networks" print(str.find('k')) print(str.count('e')) print(len (str)) print(str.replace('computer', 'data')) You are designing a program to process a list of Internet addresses representing numeric addresses of computers. Locally, computers are usually known by a nickname, as well. Numeric addresses for computers on the international network Internet are composed of four parts, separated by a space, of the form: x y z m Nickname where x y z m are positive integers and Nickname is the computer nickname (string). 1. Define a class called address_t with components for the four integers of an internet address and a fifth component in which to store an associated nickname. Define function members, with constructors, setters and getters. (address_t.h). 2. The program should implement function members. The default constructor should set the network address to (0 0 0 0 None). Define a function Compare To which takes 2 network addresses and based on the 2 first components (x, y), compares them for equality. If two computers are located on the same network then they share the same 2 components (address_t.cpp). 3. Your driver program should declare 4 objects of class address_t and read 4 computer network addresses and nicknames and store them in the 4 objects. (address_tDriver.cpp) 4. Your program should display a list of pairs of computers from the same locality -that is, each pair of computers with matching values for the first two components of the address. In the message, the computers should be identified by their nicknames Example Input: 111 22 3 44 555 66 7 88 111 22 5 66 222 33 5 77 Borneo Java Sumatra Jakarta Example Output message: Machine Borneo and Sumatra are on the same local network. Consider the following python program and write the output str="computer networks" print(str.find('k')) print(str.count('e')) print(len (str)) print(str.replace('computer', 'data')) You are designing a program to process a list of Internet addresses representing numeric addresses of computers. Locally, computers are usually known by a nickname, as well. Numeric addresses for computers on the international network Internet are composed of four parts, separated by a space, of the form: x y z m Nickname where x y z m are positive integers and Nickname is the computer nickname (string). 1. Define a class called address_t with components for the four integers of an internet address and a fifth component in which to store an associated nickname. Define function members, with constructors, setters and getters. (address_t.h). 2. The program should implement function members. The default constructor should set the network address to (0 0 0 0 None). Define a function Compare To which takes 2 network addresses and based on the 2 first components (x, y), compares them for equality. If two computers are located on the same network then they share the same 2 components (address_t.cpp). 3. Your driver program should declare 4 objects of class address_t and read 4 computer network addresses and nicknames and store them in the 4 objects. (address_tDriver.cpp) 4. Your program should display a list of pairs of computers from the same locality -that is, each pair of computers with matching values for the first two components of the address. In the message, the computers should be identified by their nicknames Example Input: 111 22 3 44 555 66 7 88 111 22 5 66 222 33 5 77 Borneo Java Sumatra Jakarta Example Output message: Machine Borneo and Sumatra are on the same local network.
Expert Answer:
Related Book For
Posted Date:
Students also viewed these computer network questions
-
answer the question clearly You are building a flight-control system for which a convincing safety case must be made. Would you assign the tasks of safety requirements engineering, test case...
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
Prove Theorem 9.7.1. Theorem 9.7.1 Principal Axes Theorem for ft3 Let ax2 + by2 + cz2 + 2dxy + 2exz + 2fyz + gx + hy + iz + j = 0 be the equation of a quadric Q, and let xTAx = ax2 + by2 + cz2 + 2dxy...
-
A large school district is reevaluating its teachers' salaries. They have decided to use regression analysis to predict mean teachers' salaries at each elementary school. The researcher uses years of...
-
(Issuance and Retirement of Bonds) Venezuela Co. is building a new hockey arena at a cost of $2,500,000. It received a down payment of $500,000 from local businesses to support the project, and now...
-
Prepare the income statement for West Nautical Company in E2-31A for the most recent year. Assume that the company sold 34,000 units of its product at a price of $12 each during the year. Data From...
-
Use the shooting method to solve Prob. 27.1.
-
A 20N force acts perpendicular to the door 0.8m wide at its edge. Find moment at hinges. Also find moment at hinges if 20N force acts at 60 with the plane of door. i) 20N force acting perpendicular...
-
Applying Overhead to Jobs, Costing Jobs Gorman Company builds internal conveyor equipment to client specifications. On October 1, Job 877 was in process with a cost of $18,700 to date. During...
-
Solve for x. log2()+log2(x-4)=5 x = (Separate answers by a comma.) If the answer is radical use sqrt(5) to denote 5 (use the correct radicand in the problem!) If the answer is a fraction then write...
-
What is Chem - Med s average accounts receivable collection period for 2 0 1 5 , 2 0 1 6 , 2 0 1 7 , 2 0 1 8 ? Is the period getting longer or shorter? What are the consequences?
-
A start-up software company hires Kiera as its first human resource manager. Whenever a new position needs to be filled, Kiera sits down with the supervisor to gather facts that will be included in a...
-
1 . To what extent ( if any ) is Lorne Albaum blameworthy for the Taylor s losses? Please explain your rationale. Assume that TRC Capital is not violating U . S . or Canadian securities law. Under...
-
Scarcity and Abundance Is lunch ever free? The central economic problem is scarcity. But are all goods and services scarce? Is anything we desire truly abundant? First, what do we mean by abundance?...
-
Explain the architecture of digital computers in terms of computer hardware? Discuss it using a suitable diagram.
-
Why did management adopt the new plan even though it provides a smaller expected number of exposures than the original plan recommended by the original linear programming model?
-
Example 11-1: What Additional Information Is Required? How would this example change if a CSTR were used instead of a PFR? Example 11-1 The first-order liquid-phase reaction A B is carried out in a...
-
The elementary gas-phase reaction 2A C is carried out in a packed-bed reactor. Pure A enters the reactor at a 450-K flow rate of 10 mol/s, and a concentration of 0.25 mol/dm 3 . The PBR contains 90...
-
Go to the LearnChemE screencast link for Chapter 9 (http://www.umich.edu/~elements/6e/09chap/learn-cheme-videos.html). 1. View one of the screencast 5- to 6-minute video (1) PSSH, (2) Cell Growth,...
-
Christina throws a javelin into the air. As she propels it forward from rest, she does 270 J of work on it. At its highest point, its gravitational potential energy has increased by 70 J. What is the...
-
Two samples of ideal gas, sample 1 and sample 2, have the same thermal energy. Sample l has twice as many atoms as sample 2. What can we say about the temperatures of the two samples? A. T>T B. T = T...
-
Crane l uses 10 kJ of energy to lift a 50 kg box to the roof of a building. Crane 2 uses 20 kl to lift a 100 kg box the same distance. Which crane is more efficient? A. Crane 1 B. Crane 2 C. Both...
Study smarter with the SolutionInn App