subject

This question involves a class named filetext that represents a text file. public class filetext { private string filename; private int filebytes; private arraylist‹string› wordlist; // the contents of the text file // constructors not shown // postcondition: calculates the number of bytes in this file and updates // the instance variable filebytes public void filesize() { } // precondition: 0 < newwords. length < wordlist. size () // postcondition: elements from the newwords array are placed into consecutive // even index positions, including 0, of the wordlist arraylist // postcondition: the value of filebytes is updated public void mergewords(string[] newwords) { } // other methods not shown }the wordlist arraylist stores the words (tokens) found in a text file. suppose wordlist contains the following elements: [mary, had, a, little, lamb]the filesize method; the size of the file is computed in bytes. each character in a word counts as one byte. in addition, there is a space in between each word, and each of those spaces also counts as one byte. for the example above, the filesize method would compute 4 + 3 + 1 + 6 + 4 as the sum of the lengths of each string in the arraylist. the value of filebytes would be this sum plus 4, because there would be 4 spaces in between the 5 words. for the mergewords method, assume the values for the newwords array are as follows: {"one", "two", "three"}after the method has executed, filebytes will have an updated value, and wordlist would contain the following elements: [one, mary, two, had, three, a, little, lamb]complete the filesize and mergewords methods below. be sure to include the method headers.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 01:30
Which tab is used to change the theme of a photo album slide show? a. design b. view c. transitions d. home
Answers: 1
question
Computers and Technology, 24.06.2019 00:00
Which tool could be used to display only rows containing presidents who served two terms
Answers: 3
question
Computers and Technology, 24.06.2019 12:50
What percentage of teens plays video games? a.97% b.100% c.74% d.50%
Answers: 1
question
Computers and Technology, 24.06.2019 13:20
3. ranga ramasesh is the operations manager for a firm that is trying to decide which one of four countries it should research for possible outsourcing providers. the first step is to select a country based on cultural risk factors, which are critical to eventual business success with the provider. ranga has reviewed outsourcing provider directories and found that the four countries in the table that follows have an ample number of providers from which they can choose. to aid in the country selection step, he has enlisted the aid of a cultural expert, john wang, who has provided ratings of the various criteria in the table. the resulting ratings are on a 1 to 10 scale, where 1 is a low risk and 10 is a high risk. john has also determined six criteria weightins: trust, with a weight of 0.3; quality, with 0.2; religious, with 0.1; individualism, with 0.2; time, with 0.1; and uncertainity, with 0.1. using the factor-rating method, which country should ranga select? why? (2 points)
Answers: 3
You know the right answer?
This question involves a class named filetext that represents a text file. public class filetext { p...
Questions
question
Mathematics, 15.11.2020 08:10
question
Law, 15.11.2020 08:10
question
Mathematics, 15.11.2020 08:10
question
SAT, 15.11.2020 08:10
question
Mathematics, 15.11.2020 08:10
question
Mathematics, 15.11.2020 08:10
question
Mathematics, 15.11.2020 08:10
question
Mathematics, 15.11.2020 08:10