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
Mars2501 [29]
3 years ago
3

HTTP is the protocol that governs communications between web servers and web clients (i.e. browsers). Part of the protocol inclu

des a status code returned by the server to tell the browser the status of its most recent page request. Some of the codes and their meanings are listed below:
200, OK (fulfilled)

403, forbidden

404, not found

500, server error

Given an int variable status, write a switch statement that prints out the appropriate label from the above list based on status.

I need this answer in java not c++ and i can't seem to find a java answer

Computers and Technology
1 answer:
Sholpan [36]3 years ago
8 0

Answer:

Here is the JAVA program:  

class Main {  //class name

 public static void main(String[] args) {  //start of main method

   int status = 200;  //sets status to 200

   switch( status ){  //switch statement

case 200:  //if code is 200

System.out.println("OK (fulfilled)");  //displays OK (fulfilled) if case is 200

break;

case 403:  //if code is 403

System.out.println("forbidden");  //displays forbidden if case is 403

break;

case 404:  //if code is 404

System.out.println("not found");    //displays not found if case is 404

break;

case 500:  //if code is 500

System.out.println("server error");  //displays server error if case is 500

break;

default:  //if status is set to code other than above codes

System.out.println("Unknown code");  //displays Unknown code

break;   }    }   }

Explanation:

If you want to take the status code as input from user then use the following statements:

int status;

Scanner input = new Scanner(System.in);

System.out.print("Enter status code: ");      

       status= input.nextInt();

After this you can add the switch code chunk in the Answers section. Also import the Scanner class to take status code as input from user:

import java.util.Scanner;

The screenshot of the program along with its output is attached.

You might be interested in
Consider the Google Trends graph of dogs and cats. Give a plausible explanation or hypothesis for the spike in dog searches that
Nataly [62]

Answer:

The correct answer for: Consider the Google Trends graph of dogs and cats. Give a plausible explanation or hypothesis for the spike in dog searches that occurred between 2014 and 2015 that would lead to further investigation or research. Give your explanation and what you would want to investigate next. Is: b. dog rescues someone.

Explanation:

All right. The topic I would lie t investigate next is dogs rescue someone. Because first of all, the word dog by itself wouldn't generate such a spike in searches. c) option new dog breed seems quite difficult because for a new dog breed to be created. There has to be a hundred-year period to make the genetic design and also it has to be allowed by the kennel club as well as organizations that seek for dog's health and wellbeing. That leaves dog attack and dog rescues someone in the final mile. A dog attack is something not very common but that happens. Nevertheless, even though it is relevant it wouldn't as impressive and pivoting as a dog rescuing someone. The reason behind my posture is that as a story is not very promising, it could be a little bit yellow journalism and won't be as accepted and shared as a good act from a dog.

7 0
3 years ago
How is the internet a vast network?
8_murik_8 [283]

Answer:

it help you with what you need to ask and more

Explanation:

5 0
3 years ago
What is the HIPAA privacy rule, and why does it affect IT professionals.
user100 [1]
It protects a persons identifiable health information and medical records.
4 0
2 years ago
you just bought a new hard drive for your computer you plan to use this as a secondary hard drive to store all um a files once i
mihalych1998 [28]
Well, you need to partition your hard drive. Partitioning your hard drive designates usable space on your hdd.

And you need to format your hard drive. Formatting installs a file system on to your hard drive, it allows the operating system to read, write and overall understand the data stored on the disk. Without it, an OS cannot keep track of file locations, nor can it typically identify already used sectors (space) on a hdd. 
However, neither of these two concepts are tests.  
7 0
3 years ago
Andy wants to change some of the components in his old computer system.he had recently upgraded the motherboard and he now wishe
ladessa [460]

Looking at the images and the boxes, it goes like this;


To add external functionality of external backup, you would probably have something removable from the computer accessable. This means that the Optical Drive would add functionality of external backup, and the first tile goes there.


A processor is what does the general computations inside a laptop/desktop computer and processes information as the name implies. Upgrading the processor makes it go faster. The second tile would go to the processor.


The third one need no further explanation and would go to the Hard Drive, but just keep in mind that the Hard Drive stores all the information on your computer (i.e. Applications, Photos, etc.).


Hope this helps!

6 0
3 years ago
Read 2 more answers
Other questions:
  • Design a class called NumDays. The class’s purpose is to store a value that represents a number of work hours and convert it to
    13·2 answers
  • You are a very small company that sells healthcare insurance plans. You estimate that the breach of your customer database will
    6·1 answer
  • Today’s mobile phones and some PCs use a touch user interface called a _____ to allow people to control the personal computer.
    7·1 answer
  • If a user cut a section from a photograph where is the cut sections location
    10·1 answer
  • The idea behind ____ is that the peripheral can simply be plugged in and turned on, and that the computer should dynamically rec
    10·1 answer
  • Design the logic for a program that allows a user to enter 20 numbers, then displays each number and its difference from the num
    13·1 answer
  • Only the Windows Server 2016 Standard and Datacenter editions are compatible with the common language runtime used in Microsoft
    7·1 answer
  • I NEED HELPS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! UWU
    9·1 answer
  • Computers are used because they :
    9·2 answers
  • Which protocol is responsible for transporting files between a client and a server?
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!