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
OLga [1]
3 years ago
7

I need help in creating a Java Program; To calculate the chapter from which you solve the programming exercise, below are the re

quirements;
• Divide the integer number representing your student ID by 4, consider the remainder and increment it by 2. The result you obtain represents the chapter number, and it should be either 2, 3 , 5 or 6.

* Depending on the chapter number obtained above, consider the following rules in calculating the problem number to solve:

• If the chapter number is 2, divide your student ID by 23, consider the remainder and increment it by 1. The result you obtain represents the number of the programming exercise you will solve for online discussions, which should be from chapter 2.

• If the chapter number is 3, divide your student ID by 34, consider the remainder and increment it by 1. The result you obtain represents the number of the programming exercise you will solve for online discussions, which should be from chapter 3.

• If the chapter number is 4 (you need to go to chapter 6), divide your student ID by 38, consider the remainder and increment it by 1. The result you obtain represents the number of the programming exercise you will solve for online discussions, which should be from chapter 6.

• If the chapter number is 5, divide your student ID by 46, consider the remainder and increment it by 1. The result you obtain represents the number of the programming exercise you will solve for online discussions, which should be from chapter 5.

*After calculating the number of the chapter, and the number of the programming exercise to solve, ask the user to enter the page number where the specific problem is located in the textbook. Display the requirement for the programming exercise using the following format: "Please solve programming exercise … (include here the number of the exercise) from chapter … (include here the number of the chapter), from page … (include here the page number)."
Computers and Technology
1 answer:
Vinvika [58]3 years ago
8 0

Answer:

 public static void main(String[] args)

 {

   int studentnumber = 123456;

   int divisor = 0;

   int chapter = (studentnumber%4)+2;

   

   switch(chapter) {

     case 2:

      divisor = 23;

      break;

     case 3:  

      divisor = 34;

       break;

     case 4:

      divisor = 38;

       break;

     case 5:  

      divisor = 46;

       break;

   }

   

   int exercise = (studentnumber % divisor) + 1;

   

  System.out.printf("Studentnumber %d divided by 4 plus 2 is chapter %d.\n", studentnumber, chapter);        

  System.out.printf("Studentnumber %d divided by %d is exercise %d.", studentnumber, divisor, exercise);  

 }

Explanation:

Above is just a bit of code to get you started with the first part. Hope you can figure out the rest.

You might be interested in
What does Verizon child allow parents to do? My parents recently got the app and put it on my phone so I was wondering...
HACTEHA [7]
It allows them to turn on and turn off your internet; also if you were wondering incognito or any private browsing still countermeasures all devises they can use to access your history
4 0
3 years ago
What is a characteristic ofa good cloud-based hosting?
Aliun [14]

Answer:

Explanation:

A good cloud-based hosting has many beneficial characteristics, some of which include on-demand self-service, broad network access, and being very elastic and scalable. These characteristics allow for a large number of users to benefit from the service at any time of the day and at a very fast speed due to the broad network access.

6 0
3 years ago
Proponents of Internet freedom see its _____________ as providing protection for unpopular expression; proponents of greater Int
NeTakaya

Answer: The answer is anonymity

Explanation: i had the same question on my test.

8 0
3 years ago
The word blog is made from what two terms?
mafiozo [28]
• web + log = blog •
3 0
4 years ago
You may declare an unlimited number of variables in a statement as long as the variables are ____.
k0ka [10]

Answer:

b. the same data type

Explanation:

Any number of variables can be declared in a statement as long as the variables have the same data type. For example:

1) int a,b,c,d,e;

Here each of the declared variables a,b,c,d,e have the type int.

2) char p,q,r,s,t,u,v,w;

In this case variables p to w all have the type char.

3) float x,y,z;

x,y and z are all of type float.

6 0
4 years ago
Other questions:
  • Categorize the following relationships into generalization, aggregation, or association. Beware, there may be n-ary associations
    14·1 answer
  • You are asked to optimize a cache design for the given references. Th ere are three direct-mapped cache designs possible, all wi
    7·1 answer
  • Match these items. 1 . Naturalization Act stated that a foreigner had to live in the United States fourteen years to become a ci
    5·1 answer
  • Rapid development programming languages eliminate the possibility of having bugs in code. True or False
    8·1 answer
  • Which of the following types of cloud platforms would a webmail service offered to the general public be considered?
    9·1 answer
  • Select a cybersecurity career that interests you. Describe the job duties and identify the skills required to excel in that care
    15·1 answer
  • What is Quantum Cryptography? How is it different from Public and Private-key transactions?
    6·1 answer
  • How do news organizations primarily create revenue?
    12·2 answers
  • Which pickaxe in minecraft to use?
    14·1 answer
  • What is the console.log function for?​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!