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
posledela
3 years ago
10

To calculate the chapter from which you must solve the programming exercise, divide the integer number representing your student

ID by 3, consider the remainder (either 0, 1 or 2) and increment it by 3. The result you obtain represents the chapter number, and it should be 3, 4 or 5.
Computers and Technology
1 answer:
Mashutka [201]3 years ago
7 0

Answer:

<em>import java.util.Scanner;</em>

<em>public class ANot {</em>

<em>    public static void main(String[] args) {</em>

<em>        System.out.println("Please Enter Your Student ID");</em>

<em>        Scanner in = new Scanner(System.in);</em>

<em>        int yourId = in.nextInt();</em>

<em>       int chapterToRead = (yourId%3)+3;</em>

<em>        System.out.println("You are to read chapter: "+chapterToRead);</em>

<em>    }</em>

<em>}</em>

Explanation:

This solution is implemented in Java programming language. The scanner class is used to receive user input which is saved in an int variable yourId. In order to obtain the remainder when the students' ID is divided by 3, we use the modulo (%) operator which returns the remainder

You might be interested in
Are the actions legal or illegal?
garik1379 [7]

Answer:

No, Company will not pay

Explanation:

At the last point of the final deal, any significant sum of money does not fall into the frame.

It was important to address the exact amount needed to update the research on agriculture. They might be asking for inflated amounts.

3 0
3 years ago
write a c++program that allows the user to enter the last names of fivecandidates in a local election and the number of votes re
madreJ [45]

Answer:

#include<iostream>

#include<stdlib.h>

using namespace std;

int main(){

   //initialization

   string str1[5];

   int arr_Vote[5];

   int Total_Vote=0,max1_Index;

   int max1=INT_MIN;

   //loop for storing input enter by user

   for(int i=0;i<5;i++){

       cout<<"Enter the last name of candidate: "<<endl;

       cin>>str1[i];

       cout<<"Enter the number of vote receive by the candidate: "<<endl;

       cin>>arr_Vote[i];

       //calculate the sum

       Total_Vote = Total_Vote + arr_Vote[i];

       //find the index of maximum vote

       if(arr_Vote[i]>max1){

           max1=arr_Vote[i];

           max1_Index=i;

       }

   }

   //display

   cout<<"\nThe output is......"<<endl;

   //loop for display data of each candidate

   for(int i=0;i<5;i++){

       cout<<str1[i]<<"\t"<<arr_Vote[i]<<"\t"     <<float(arr_Vote[i]*100)/Total_Vote<<"%"<<endl;

   }

   //display winner

   cout<<"The winner candidate is"<<endl;

   cout<<str1[max1_Index]<<"\t"<<arr_Vote[max1_Index]<<"\t"<<float(arr_Vote[max1_Index]*100)/Total_Vote<<" %"<<endl;

}

Explanation:

Create the main function and declare the two arrays and variables.

the first array for storing the names, so it must be a string type. second array stores the votes, so it must be int type.

after that, take a for loop and it runs for 5 times and storing the values entered by the user in the arrays.

we also calculate the sum by adding the array data one by one.

In the same loop, we also find the index of the maximum vote. take an if statement and it checks the element in the array is greater than the max1 variable. Max1 variable contains the very small value INT_MIN.

If condition true, update the max1 value and update the max1_Index value.

The above process continues for each candidate for 5 times.

After that, take a for loop and display the data along with percentage by using the formula:

Vote\,percent=\frac{Vote\,receive*100}{Total\,vote}

the, finally display the winner by using the max1_Index value.  

5 0
2 years ago
The variety of theatre introduced in the 1960s that denotes semi-professional or even amateur theatre in the New York/Manhattan
antoniya [11.8K]

Answer:

The answer is letter A. TRUE

Explanation:

The variety of theatre introduced in the 1960s that denotes semi-professional or even amateur theatre in the New York/Manhattan area, often in locations such as church basements, YMCAs, and coffeehouses, is commonly known as off-off-Broadway.  This statement is true.

3 0
3 years ago
Assuming dataFile is an ofstream object associated with a disk file named payroll.dat, which of the following statements would w
svet-max [94.6K]

Answer:

dataFile << salary;

Explanation:

To write salary to a file (payroll.dat) using ofstream, you make use of the following instruction:

<em>ofstream dataFile; </em>

<em>myfile.open ("payroll.dat"); </em>

<em>myfile <<salary; </em>

<em>myfile.close();</em>

<em />

This line creates an instance of ofstream

<em>ofstream dataFile; </em>

This line opens the file payroll.dat

<em>myfile.open ("payroll.dat"); </em>

This is where the exact instruction in the question is done. This writes the value of salary to payroll.dat

<em>myfile <<salary; </em>

This closes the opened file

<em>myfile.close();</em>

<em />

<em />

8 0
2 years ago
How do I change my username/display name
exis [7]

Answer:

.

Explanation:

you do to me on the bottom bar and once you hit that you click the pencil and change it

6 0
2 years ago
Read 2 more answers
Other questions:
  • When should an individual consider entering parenthood?
    5·1 answer
  • Wide area networks are defined by their ability to
    14·2 answers
  • What does snap do need the answer now
    10·2 answers
  • What is the name for the type of flash memory that is used by mobile devices to store their apps and data?
    6·1 answer
  • A(n) _______ gate provides an output of 1 if either or both inputs are 1.
    14·2 answers
  • Which of these expressions is used to check whether num is equal to value?
    13·1 answer
  • In a network, multiple critical paths can occur. true or false
    13·2 answers
  • Direction: Read each item carefully and choose the letter of the correct answer. Write your answers on a separate sheet of paper
    12·1 answer
  • What is a photographic print made from a negative image?
    7·1 answer
  • A computer is the __________ of an attack when it is used to conduct an attack against another computer.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!