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
Alik [6]
3 years ago
9

The array s of ints contain integers each of which is between 1 and 1000 (inclusive). write code that stores in the variable ord

inals the array of strings consisting of each number followed by its ordinal number abbreviation, "st", "nd", "rd", or "th". for example if s is the array
Computers and Technology
1 answer:
bearhunter [10]3 years ago
7 0

Answer and  Explanation

An array holds a fixed number of values of a single type. Its length is established when the array is created where the length is fixed after the creation.In c programming an array is a collection of data items all of them of the same type and accessed using a common name while in Java  they are items that are dynamically created and all elements have the same type called the component type  of the array.

//takes an array of int and returns an array of String the way you want!  

public String[] setOrdinal(int[] arr)  

{  

String[] ord = new String[arr.length];  

for(int i = 0; i < ord.length; i++)  

{  

ord[i] = convert(arr[i]);  

}  

return ord;  

}  


//takes a number and converts it to string and adds the proper letters


private String convert(int num)  

{  

if(num > 1000 || num <=0)  

return "Not in range";  

else if(num%10==0 || num%10==9 || num%10==8 || num%10==7 || num%10==6 || num%10==5 || num%10==4 || num%10==3)  

{  

return String.valueOf(num) + "th";  

}  

else if(num%10==2)  

{  

if((num/10)%10==1) //checks if the second digit is 1  

return String.valueOf(num) + "th";  

else  

return String.valueOf(num) + "nd";  

}  

else  

{  

if((num/10)%10==1)  

return String.valueOf(num) + "th";  

else  

return String.valueOf(num) + "st";  

}

}

You might be interested in
Compare a Wi-Fi hotspot with a cybercafé.
erik [133]

Answer:

A WiFi Hotspot is a wireless internet connection that allows a computer, smartphone, or any other internet-enabled devices to connect to internet access points.

A cybercafe refers to any business place that allows people to access the internet usually within its premises after paying for connection access to connect to it.

Explanation:

3 0
3 years ago
Employing the use of a(n) <br> will help you manage a STEM project.
LiRa [457]

Answer:

technicians

Explanation:

the answer is technicians. in my freshmen year we made flash cards and i still have them so i remember it.

7 0
3 years ago
Jose is upgrading the memory on his laptop. The laptop has two slots for RAM, but one of them is currently being occupied. He ha
inn [45]

Answer:

Reseat the new stick of RAM

Explanation:

Joe needs to reseat the new stick of the RAM. For that, he should gently release the clips which hold RAM in the correct posture, and one on each side. Joe is required to do this for each of the available memory modules. And then he will have the cautiously replace all the memory modules( 2 in number) through to DIMM slots which are on the motherboard. Make sure that you have noted down the locations of each notches on the RAM as well as the DIMM slots.

3 0
3 years ago
MD5 uses a hash value to create a hash which is typically a 32 character hex number and how many bits?
ryzh [129]

Answer:

128 bits

Explanation:

The MD5, which is the acronym for Message-Digest algorithm 5, invented by a professor of MIT, Ronald Rivest, is a cryptographic hash algorithm that creates a 128 bit hash value and is typically represented as a 32 character hex number. MD5 is the improved version of MD4 which was also created by the same professor.

Following is an example format of an MD5 hash;

<em>ef55d3a698d289f2afd663725127bccc</em>

MD5 has been proven to have security issues. One of these issues is called collision attack - a situation where the same hash is produced for different input data.

8 0
4 years ago
which role validates the users identity when using saml for authentication? rp user agent sp idp see all questions back next que
katrin2010 [14]

A role which validates the user's identity when using Security Assertion Markup Language (SAML) for authentication is: D. IDP.

<h3>What is IDS?</h3>

IDS is an abbreviation for intrusion detection system and it can be defined as a type of information security (IS) system which is designed and developed to monitor network traffic, validates an end user's identity, and notifies the network engineer when there's a malicious activity.

In Cyber security, a role which is saddled with the responsibility of validating an end user's identity when using Security Assertion Markup Language (SAML) for authentication is the intrusion detection system (IDP).

Read more on intrusion detection system here: brainly.com/question/14284690

#SPJ1

Complete Question:

Which role validates the user's identity when using SAML for authentication?

1) IdP. 2) SP. 3) User agent. 4) RP.

5 0
1 year ago
Other questions:
  • What symbol following a menu command lets you know that a dialog box will be displayed?
    14·1 answer
  • List and describe the three types of cloud models described by Microsoft.
    9·1 answer
  • Which one of the following may be used as an input as well as an output device? A. Fax machine B. Scanner C. Printer D. Voice re
    9·1 answer
  • Use the drop-down menus to complete each sentence about the layers of the atmosphere.
    14·2 answers
  • Open the same text file that you have created in Exercise-Four ( in the sample output, I have created the file name personal). W
    7·1 answer
  • Plz help
    10·1 answer
  • Will give brainliest
    14·1 answer
  • Sarah is a detall-oriented programmer. While testing her program, what other skill would she have to apply in order to detect al
    9·1 answer
  • What is folded card publishing?​
    5·2 answers
  • HURRYY!!!<br> In the movie "Spare Parts" why can't Oscar enlist in the armed forces????
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!