1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Andre45 [30]
2 years ago
7

Which xxx completes the code to read every integer from file "data. txt"? fileinputstream inputstream = null; scanner infs = nul

l; int total = 0; inputstream = new fileinputstream("data. txt"); infs = new scanner(filebytestream); while(xxx){ total = total + infs. nextint(); } system. out. println("total: " + total); group of answer choices inputstream. hasnextint( ) total != 0 infs. hasnextint( ) infs. eof( ) == false
Computers and Technology
1 answer:
luda_lava [24]2 years ago
3 0

Answer:

total+ infs . nex (xxx){total}

Explanation:

this is correct theres nothing wrong

You might be interested in
Write a program to read a list of exam scores given as integer percentages in the range 0-100. Display the total number of grade
Tju [1.3M]

Answer:

import java.util.Scanner;

public class Program

{

  public static void main(String [] Args)

  {

      int totalAGrades = 0, totalBGrades = 0, totalCGrades = 0, totalDGrades = 0, totalFGrades = 0, counter=0,maximum = 0, minimum = 9999, num, total = 0,smallest = 0,largest = 0;

       Scanner in = new Scanner(System.in);

       System.out.println("Enter exam percentage: ");

       System.out.println("Enter a negative examScore: ");

       int examScore = in.nextInt();

       while(examScore > 0)

       {

         counter++;

         if(examScore < 0){          

             break;}  

         else if(examScore > maximum){      

              maximum = examScore;}

         else if(examScore < minimum)   {  

              minimum = examScore;}

         

          total = total + examScore;  

     

          if(examScore <= 50 && examScore>0)

              smallest = examScore;

              if(examScore > 90 && examScore <=100)

              largest = examScore;

         

      if(examScore>=90 && examScore<=100)

          totalAGrades++;

      else if(examScore>=80 && examScore<=89)

          totalBGrades++;

      else if(examScore>=70 && examScore<=79)

          totalCGrades++;

      else if(examScore>=60 && examScore<=69)

          totalDGrades++;

      else if(examScore>=0 && examScore<=59)

          totalFGrades++;

      examScore = in.nextInt();

     

   }

      System.out.println("Total number of scores is = " + counter );

      System.out.println("Total Number of each Letter grade : " + counter);

      System.out.println("Percentage of total for each letter grade : ");

          System.out.println("Total number of A grades = "+ totalAGrades);

          System.out.println("Total number of B grades = "+ totalBGrades);

          System.out.println("Total number of C grades = "+ totalCGrades);

          System.out.println("Total number of D grades = "+ totalDGrades);

          System.out.println("Total number of F grades = "+ totalFGrades);

     

      System.out.println("Lowest exam Score is :"+smallest);

      System.out.println("Highest exam Score is :"+largest);

      System.out.println("Average exam Score = "+ (total / counter));

  }

}  

Explanation:

  • Get the exam information from user as input and run a while loop until examScore is greater than zero.
  • Use conditional statement to check the scores of students and increment the relevant grade accordingly.
  • Finally display all the information including grades and scores.
3 0
3 years ago
Design a class named Employee. The class should keep the following information in fields: Employee first name Employee last name
mixer [17]

Answer:

Explanation:

The following is written in Java and creates the Employee class with the variables requested and a getter setter method for each variable

package sample;

public class Employee {

   private String lastName, firstName, idNumber;

   

   public void Employee() {

   }

   public String getLastName() {

       return lastName;

   }

   public void setLastName(String lastName) {

       this.lastName = lastName;

   }

   public String getFirstName() {

       return firstName;

   }

   public void setFirstName(String firstName) {

       this.firstName = firstName;

   }

   public String getIdNumber() {

       return idNumber;

   }

   public void setIdNumber(String idNumber) {

       this.idNumber = idNumber;

   }

}

8 0
2 years ago
Write a for loop that prints the integers 50 through 1, each on a separate line. use no variables other than count.
Anton [14]
For( count = 50; count > 0; count-- )
    System.out.println( count );
5 0
3 years ago
Convert A4B from hexadecimal to binary. Show your work.
Rama09 [41]

Answer:

The answer is A4B₁₆ =  2635₁₀ =  101001001011₂

Explanation:

To convert from hexadecimal base system to binary base system, first you can do an intermediate conversion from hexadecimal to decimal using this formula:

where position of the x₁ is the rightmost digit of the number and the equivalents hexadecimal numbers to decimal:

  • A = 10.
  • B = 11.
  • C = 12.
  • D = 13.
  • E = 14.
  • F = 15.

A4B₁₆ = A*16²+4*16¹+B*16⁰ = 2560 + 64 + 11 = 2635₁₀

Now, you have the number transformed from hexadecimal to decimal. To convert the decimal number 2635 to binary: Divide the number repeatedly by 2, keeping track of each remainder, until we get a quotient that is equal to 0:

2635 ÷ 2 = 1317 + 1;

1317 ÷ 2 = 658 + 1;

658 ÷ 2 = 329 + 0;

329 ÷ 2 = 164 + 1;

164 ÷ 2 = 82 + 0;

82 ÷ 2 = 41 + 0;

41 ÷ 2 = 20 + 1;

20 ÷ 2 = 10 + 0;

10 ÷ 2 = 5 + 0;

5 ÷ 2 = 2 + 1;

2 ÷ 2 = 1 + 0;

1 ÷ 2 = 0 + 1;

Now, construct the integer part base 2 representation, by taking the remainders starting from the bottom of the list:

2635₁₀ =  101001001011₂

3 0
3 years ago
Where are the mail merge options located in Word 2016?
GarryVolchara [31]

Answer:

Mailings Tab, Start Mail Merge group.

Explanation:

See attached picture.

6 0
3 years ago
Other questions:
  • Yesterday Hunter's laptop screen appeared to go black. The laptop was still running, but he could not see the desktop or any gra
    9·1 answer
  • #TODO: Define a data structure to keep track of which links are part of / not part of the spanning tree.
    14·1 answer
  • A(n) _____ is a common output device for hard copy.
    9·1 answer
  • The gaining of unauthorized access to data in a<br> system or computer:
    11·1 answer
  • When you declare a string data type, you are actually creating an object from the?
    5·1 answer
  • External hard disks use different technology than internal hard disks. ture or false
    6·1 answer
  • In which step of writing a program does a programmer first use a<br> compiler?<br> documentin
    6·1 answer
  • failure of the _ cylinder will often result in sudden unexpected loss of the ability to stop the vehicle
    10·1 answer
  • Identify a true statement about heuristics: a. They are more complicated than algorithms. b. Unlike algorithms, they do not perm
    15·1 answer
  • What happens to a message when it is deleted?
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!