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
Does Rational database software lets you link multiple tables? Yes or no
Julli [10]

Answer:

yes

Explanation:

i did some research but don't take my word for it and let me know if it wrong

4 0
2 years ago
Consider a classful IPv4 address 200.200.200.200? What is its implied subnet mask? If we take the same address and append the CI
topjm [15]

Answer:

a. 255.255.255.0 (class C)

b. 255.255.255.224

Explanation:

Here, we want to give the implied subnet mask of the given classful IPV4 address

We proceed as follows;

Given IPv4 address: 200.200.200.200

Classes

Class A : 0.0.0.0 to 127.255.255.255

Class B: 128.0.0.0 to 191.255.255.255

Class C: 192.0.0.0 to 223.255.255.255

Class D: 224.0.0.0 to 239.255.255.255

so 200.200.200.200 belongs to Class C and it's subnet mask is 255.255.255.0

In CIDR(Classless Inter Domain Routing)

subnet /27 bits means 27 1s and 5 0s. so subnet

i.e 11111111.11111111.11111111.11100000 which in dotted decimal format is 255.255.255.224 .

4 0
3 years ago
Which are factors that go into a project plan?
BaLLatris [955]

Answer:

The four critical factors to planning a successful project

Explanation:

5 0
3 years ago
Which of the following is NOT shown on a PERT chart? (Points : 2) Scheduled start date
Reptile [31]

Answer:

Estimated Duration

Explanation:

A PERT Chart is a tool in Project Management that gives a graphical portrayal of an undertaking's timetable. The Program Evaluation Review Technique abbreviated as PERT separates the individual assignments of a venture for investigation.  

The most widely recognized components utilized in a PERT chart are:  

  • Span time.  
  • Activity
  • Early finish time.  
  • Early Ending time
  • Late initiation time.  
  • Late completion time.  
  • Critical path
  • Slack.  

It does not include the Estimated span of time.

4 0
3 years ago
Help please this is my last assignment of the year
krek1111 [17]

Answer:

the answer is in the website that are there

5 0
3 years ago
Other questions:
  • While working on a group project, you notice something does not look right in the presentation. You call a meeting with your tea
    14·2 answers
  • How do you perceive the importance of Internet?
    6·2 answers
  • Which tag defines the visible content of a web document?
    10·1 answer
  • Supports traditional transactional processing for day-to-day front-office operations or systems that deal directly with the cust
    11·1 answer
  • When does MMF2 inactivate an Active object? A. When the score is higher than the game's previous high score B. When the player d
    15·1 answer
  • What does the video say is the number-one requirement for Tour Guides?
    12·2 answers
  • What is meant by usability and what characteristics of an interface are used to assess a system’s usability?
    15·1 answer
  • Please helpppppppppp​
    8·1 answer
  • Please help, you don’t have to answer it i just need to know the best types of conversions
    12·1 answer
  • Write the necessary preprocessor directive to enable the use of the stream manipulators like setw and setprecision Additional No
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!