-4.75 for position D
Step-by-step explanation:
Check the explanation
Explanation:
Code to create the program in the question above:
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Scanner;
public class ReadWriteInt
{
public static void main(String args[]) throws IOException
{
Scanner input=new Scanner(System.in);
System.out.println("Enter the name of the input file:");
String inputFile=input.next();
System.out.println("Enter the name of the output file:");
String outputFile=input.next();
File fin=new File(inputFile);
File fout=new File(outputFile);
//print error, if input file does not exist
if(!fin.exists())
{
System.out.println("Error:Input file does not exist");
System.exit(0);
}
//print error, if output file does not exist
if(!fout.exists())
{
System.out.println("Error:output file does not exist");
System.exit(0);
}
//input stream to read
Scanner read=new Scanner(fin);
OutputStream os=new FileOutputStream(fout);
//output stream to write
PrintWriter write=new PrintWriter(os,true);
//read from input file until there are no numbers
while(read.hasNextLine())
{
String num=read.nextLine();
//convert the string into number
int number=Integer.parseInt(num);
//if the number is positive , write it to out put file
if(number>=0)
{
write.println(number);
System.out.println(number);
}
}
System.out.println("Positive numbers are copied successfully");
}
}
Check the explanation
Explanation:
Code to create the program in the question above:
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Scanner;
public class ReadWriteInt
{
public static void main(String args[]) throws IOException
{
Scanner input=new Scanner(System.in);
System.out.println("Enter the name of the input file:");
String inputFile=input.next();
System.out.println("Enter the name of the output file:");
String outputFile=input.next();
File fin=new File(inputFile);
File fout=new File(outputFile);
//print error, if input file does not exist
if(!fin.exists())
{
System.out.println("Error:Input file does not exist");
System.exit(0);
}
//print error, if output file does not exist
if(!fout.exists())
{
System.out.println("Error:output file does not exist");
System.exit(0);
}
//input stream to read
Scanner read=new Scanner(fin);
OutputStream os=new FileOutputStream(fout);
//output stream to write
PrintWriter write=new PrintWriter(os,true);
//read from input file until there are no numbers
while(read.hasNextLine())
{
String num=read.nextLine();
//convert the string into number
int number=Integer.parseInt(num);
//if the number is positive , write it to out put file
if(number>=0)
{
write.println(number);
System.out.println(number);
}
}
System.out.println("Positive numbers are copied successfully");
}
}
They are different to each question
Explanation:
1.- Writers rely greatly on the power of observation and must pay close attention to the detail around them to incorporate it effectively into their prose
True: Writing is a representation of the conclusions obtained through an observation process.
2.- The one thing a writer must absolutely, positively do is write
False: Writing is a process that consists of several steps:
PrewritingWriting (see Draft (document))Reviewing (see Review (writing))Editing (see Proofreading)Publishing3.- Brainstorming is the method of generating ideas through harnessing the brain's energy into a “storm”. It is a group technique to generate original ideas in a relaxed environment.
4.- Free association is a technique first used in psychoanalysis by Sigmund Freud. It consists in that the analyzed one expresses, during the sessions of the treatment, all their occurrences, ideas, images, emotions, thoughts, memories or feelings, as they are presented, without any selection, or structuring of the speech, without restriction or filter, even if the material seems incoherent, impure, impertinent or devoid of interest.
5.- I burned the dinner but not the cake, it is an example of a compound sentence. Because this has two independent clauses that have related ideas. And they are joined by the coordinating conjunction but.
6.- Another word for expository is explanatory.
This means: serving to explain.
7.- The one essential thing that a writer must do daily is read.
Voracious readers often make great writers, because being immersed in a world of words helps one better understand the nuts and bolts of writing.
8.- Searching through a magazine online for inspiration is a method to find a writing prompt. This is a brief passage of the text that provides a potential topic, idea or starting point for an original text.
9.- Style, or how something is written, is like the wrapping paper for your message.
True: In literature, the writing style is the way to express thinking in a language characteristic of an individual, period, school or nation.
10.- Writing with your ears essentially means what?
Reading your work aloud: This technique helps you detect phrases that are too long, ensures a good rhythm, finds internal rhymes, allows you to check the naturalness of the dialogues and locates small errors.
11.- In literature, your voice is your personality, or your unique thoughts and ways of expressing them that makes your writing sound just like you.
True: It is important to keep in mind that the narrator is not the author of the work: the person who writes a story also invents a narrator, who is the one who "tells" the story in the text. The narrative voice, in this context, is the voice of this narrator
12.- In literature, your voice is essentially your personality.
Through his voice, the narrator can star and be part of the events, or be just a witness who tells the facts but does not get involved in the future of the story.
13.- Worse choice goes way beyond simply choosing individual words. This statement best refers to syntax.
The syntax is the part of grammar that studies the order of words within sentences.
14.- Setting helps to set creative writing in a specific period, setting, socio-economic level, or purpose
The literary scenario is more about emotions than things. Sometimes we find long and detailed stage descriptions and they are fine, as long as they make sense in the plot, as long as they contribute something to the plot or define the character clearly.
15.- The following sentence is an example of what type of sentence structure? The main stopped suddenly
Simple: Because this only has a single verb. In this case "stop" in the past simple form.
See explaination for thr program code.
Explanation:
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Scanner;
public class ReadWriteInt
{
public static void main(String args[]) throws IOException
{
Scanner input=new Scanner(System.in);
System.out.println("Enter the name of the input file:");
String inputFile=input.next();
System.out.println("Enter the name of the output file:");
String outputFile=input.next();
File fin=new File(inputFile);
File fout=new File(outputFile);
//print error, if input file does not exist
if(!fin.exists())
{
System.out.println("Error:Input file does not exist");
System.exit(0);
}
//print error, if output file does not exist
if(!fout.exists())
{
System.out.println("Error:output file does not exist");
System.exit(0);
}
//input stream to read
Scanner read=new Scanner(fin);
OutputStream os=new FileOutputStream(fout);
//output stream to write
PrintWriter write=new PrintWriter(os,true);
//read from input file until there are no numbers
while(read.hasNextLine())
{
String num=read.nextLine();
//convert the string into number
int number=Integer.parseInt(num);
//if the number is positive , write it to out put file
if(number>=0)
{
write.println(number);
System.out.println(number);
}
}
System.out.println("Positive numbers are copied successfully");
}
}
Please check attachment for screenshot and output
They are different to each question
Explanation:
1.- Writers rely greatly on the power of observation and must pay close attention to the detail around them to incorporate it effectively into their prose
True: Writing is a representation of the conclusions obtained through an observation process.
2.- The one thing a writer must absolutely, positively do is write
False: Writing is a process that consists of several steps:
PrewritingWriting (see Draft (document))Reviewing (see Review (writing))Editing (see Proofreading)Publishing3.- Brainstorming is the method of generating ideas through harnessing the brain's energy into a “storm”. It is a group technique to generate original ideas in a relaxed environment.
4.- Free association is a technique first used in psychoanalysis by Sigmund Freud. It consists in that the analyzed one expresses, during the sessions of the treatment, all their occurrences, ideas, images, emotions, thoughts, memories or feelings, as they are presented, without any selection, or structuring of the speech, without restriction or filter, even if the material seems incoherent, impure, impertinent or devoid of interest.
5.- I burned the dinner but not the cake, it is an example of a compound sentence. Because this has two independent clauses that have related ideas. And they are joined by the coordinating conjunction but.
6.- Another word for expository is explanatory.
This means: serving to explain.
7.- The one essential thing that a writer must do daily is read.
Voracious readers often make great writers, because being immersed in a world of words helps one better understand the nuts and bolts of writing.
8.- Searching through a magazine online for inspiration is a method to find a writing prompt. This is a brief passage of the text that provides a potential topic, idea or starting point for an original text.
9.- Style, or how something is written, is like the wrapping paper for your message.
True: In literature, the writing style is the way to express thinking in a language characteristic of an individual, period, school or nation.
10.- Writing with your ears essentially means what?
Reading your work aloud: This technique helps you detect phrases that are too long, ensures a good rhythm, finds internal rhymes, allows you to check the naturalness of the dialogues and locates small errors.
11.- In literature, your voice is your personality, or your unique thoughts and ways of expressing them that makes your writing sound just like you.
True: It is important to keep in mind that the narrator is not the author of the work: the person who writes a story also invents a narrator, who is the one who "tells" the story in the text. The narrative voice, in this context, is the voice of this narrator
12.- In literature, your voice is essentially your personality.
Through his voice, the narrator can star and be part of the events, or be just a witness who tells the facts but does not get involved in the future of the story.
13.- Worse choice goes way beyond simply choosing individual words. This statement best refers to syntax.
The syntax is the part of grammar that studies the order of words within sentences.
14.- Setting helps to set creative writing in a specific period, setting, socio-economic level, or purpose
The literary scenario is more about emotions than things. Sometimes we find long and detailed stage descriptions and they are fine, as long as they make sense in the plot, as long as they contribute something to the plot or define the character clearly.
15.- The following sentence is an example of what type of sentence structure? The main stopped suddenly
Simple: Because this only has a single verb. In this case "stop" in the past simple form.
It will take 19.19 ms to transfer sector 1 on track 8 to sector 1 on track 9
The given parameters are:
--- the disk rotation
--- the sectors in a track
Calculate the time (t) to complete one revolution
So, the time to read/write to a sector is:
This gives
Convert to ms
Next, calculate the rotation time to head up sector 1 on track 8 to sector 1 on track 9
This is calculated as:
So, we have:
Convert to ms
So, the required time to transfer sectors is:
Time = 2 * Time to read/write to a sector + Seek time + Rotation time
This gives
Hence, it will take 19.19 ms to transfer sector 1 on track 8 to sector 1 on track 9
Read more about disk rotation at:
link
It will take 19.19 ms to transfer sector 1 on track 8 to sector 1 on track 9
The given parameters are:
--- the disk rotation
--- the sectors in a track
Calculate the time (t) to complete one revolution
So, the time to read/write to a sector is:
This gives
Convert to ms
Next, calculate the rotation time to head up sector 1 on track 8 to sector 1 on track 9
This is calculated as:
So, we have:
Convert to ms
So, the required time to transfer sectors is:
Time = 2 * Time to read/write to a sector + Seek time + Rotation time
This gives
Hence, it will take 19.19 ms to transfer sector 1 on track 8 to sector 1 on track 9
Read more about disk rotation at:
link
1) People are poisoning the environment with chemicals merely to keep their lawns clean. It says why people do what they do, but the others don't.
This is my coronavirus claim: The coronavirus has affected so many people because they never follow the safety guidelines of washing hands and wearing a mask.
Hope this helps:)
1) People are poisoning the environment with chemicals merely to keep their lawns clean. It says why people do what they do, but the others don't.
This is my coronavirus claim: The coronavirus has affected so many people because they never follow the safety guidelines of washing hands and wearing a mask.
Hope this helps:)
It will provide an instant answer!