subject

Alright, ladies and gentlemen, this computer science review question has me stumped. the directions are as follows:

this question involves a class named textfile that represents a text file.
public class textfile
{
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()
{

}

after looking over the instructions, i'm practically brainless in regards to where i'm supposed to go from here. i need to return the results of the filesize method and i have no idea how to do it. if anyone could me out, it'd be greatly appreciated!

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 00:30
Quic which one of the following is the most accurate definition of technology? a electronic tools that improve functionality b electronic tools that provide entertainment or practical value c any type of tool that serves a practical function d any type of tool that enhances communication
Answers: 1
question
Computers and Technology, 23.06.2019 02:00
Read this excerpt from helen keller’s autobiography, the story of my life. have you ever been at sea in a dense fog, when it seemed as if a tangible white darkness shut you in, and the great ship, tense and anxious, groped her way toward the shore with plummet and sounding-line, and you waited with beating heart for something to happen? i was like that ship before my education began, only i was without compass or sounding-line, and had no way of knowing how near the harbour was. "light! give me light! " was the wordless cry of my soul, and the light of love shone on me in that very hour. . the morning after my teacher came she led me into her room and gave me a doll. the little blind children at the perkins institution had sent it and laura bridgman had dressed it; but i did not know this until afterward. when i had played with it a little while, miss sullivan slowly spelled into my hand the word "d-o-l-l." i was at once interested in this finger play and tried to imitate it. when i finally succeeded in making the letters correctly i was flushed with childish pleasure and pride. running downstairs to my mother i held up my hand and made the letters for doll. i did not know that i was spelling a word or even that words existed; i was simply making my fingers go in monkey-like imitation. in the days that followed i learned to spell in this uncomprehending way a great many words, among them pin, hat, cup and a few verbs like sit, stand and walk. based on this excerpt, which words best describe helen keller?
Answers: 2
question
Computers and Technology, 24.06.2019 12:40
Match the feature to the network architecture. expensive to set up useful for a small organization easy to track files has a central server inexpensive to set up difficult to track files useful for a large organization does not have a central server client- server network peer-to-peer network
Answers: 3
question
Computers and Technology, 24.06.2019 15:00
What questions about an audience should be asked during presentation preparation? check all that apply. what does the audience already know about the topic? how will multimedia tools inspire the audience? is the information interesting and engaging? how will this information affect the presentation? will the audience change the message’s purpose? what is likely to interest the audience?
Answers: 3
You know the right answer?
Alright, ladies and gentlemen, this computer science review question has me stumped. the directions...
Questions
question
Mathematics, 19.09.2019 18:30
Questions on the website: 13722363