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
zvonat [6]
2 years ago
14

Consider the following method, which is intended to return the index of the first negative integer in a given array of integers.

public int positionOfFirstNegative(int[] values) { int index = 0; while (values[index] >= 0) { index++; } return index; } What precondition is needed on the values array so that the method will work as intended?
Computers and Technology
1 answer:
Aleksandr [31]2 years ago
3 0

Answer:

The answer is "The array values must contain at least one negative integer".

Explanation:

In the above-given code, a method "positionOfFirstNegative" is declared, that accepts an array "values" as a parameter, inside the method an integer variable index is declared, that use in the while loop to check array value is greater than equal to 0, if the conditional is true it will increments the index value and return its value, that's why in this question array value include at least one negative value.

You might be interested in
Write only in C, not C++.
yawa3891 [41]

Answer:

#include <iostream>

using namespace std;

int main() {

  int k;

double d;

string s;

cin >> k >> d >> s;

cout << s << " " << d << " " << k << "\n" << k << " " << d << " " << s; }

                                                                   

Explanation:

k is int type variable that stores integer values.

d is double type variable that stores real number.

s is string type variable that stores word.

cin statement is used to take input from user. cin takes an integer, a real number and a word from user. The user first enters an integer value, then a real number and then a small word as input.

cout statement is used to display the output on the screen. cout displays the value of k, d and s which entered by user.

First the values of k, d and s are displayed in reverse order. This means the word is displayed first, then the real number and then the integer separated again by EXACTLY one space from each other. " " used to represent a single space.

Then next line \n is used to produce a new line.

So in the next line values of k, d and s are displayed in original order (the integer , the real, and the word), separated again by EXACTLY one space from each other.

The program along with the output is attached.

7 0
3 years ago
Windows uses a memory-management technique known as ________ to monitor which applications you use most frequently and then prel
lukranit [14]

Answer:

SuperFetch

Explanation:

Superfetch is a memory management technique on windows service that enables or fetch frequently use applications on systems and launch them faster because the frequently use applications has been preload into the system memory for easy access when they want to be used.

SuperFetch always takes notice of all application running on your system in which when you exit a frequently used application SuperFetch will preload them immediately since it is saved on the system memory.

One of the most important part of Superfetch is that it saves alot of time because you don't have to search the applications before you get access to them in as far as the application was frequently used.

5 0
3 years ago
An understanding of basic psychology can help design and marketing teams ensure they meet their intended audience.
Kamila [148]

Answer:

um true i think cause to understand something or someone you have to help it to find it place in the world by make design for them and have a team to help you so they can that there audience if that help you plz mark me brainliest if not then you don't have to

Explanation:

5 0
3 years ago
Read 2 more answers
explain why the database system would not allow a tuple to be inserted into the database through this view
Andrej [43]
For the view of Exercise 4.18, explain why the database system would not allow a tuple to be inserted into the database through this view.
For reference
For the database of Figure 4.12, write a query to find the ID of each employee with no manager. Note that an employee may simply have no manager listed or may have a null manager. Write your query using an outer join and then write it again using no outer join at all.
OUTER JOIN
select e.ID from employee e left outer join manages m on e.ID = m.ID
where m.manager_id is null;
NO OUTER
select e.ID from employee e where e.ID not in (select m.ID from manages m) or e.ID in (select m.ID from manages m where m.manager_id is null);
6 0
2 years ago
3423509 join the kahoot its for fun its about the holidayss:)
zheka24 [161]

Answer:

:)

Explanation:

7 0
3 years ago
Other questions:
  • Which type of denial of service attack exploits the existence of software flaws to disrupt a service?
    12·1 answer
  • What is the difference between a design pattern and a DLL?
    12·1 answer
  • The goal expressed in this definition states that data visualization is about ________________ .
    11·2 answers
  • Each device attached to your computer comes with a special program called a(n ________ that enables the device and operating sys
    15·1 answer
  • which of the following statements about matter is true a.matter is anything that occupies space and possesses mass b.matter can
    5·2 answers
  • What keyword must be used on any method (function) on your class that is called from your main() method?
    15·1 answer
  • Write an application that allows a user to input the height and width of a rectangle. It should output the area and perimeter of
    10·1 answer
  • Consider a DataFrame named df with columns named P2010, P2011, P2012, P2013, 2014 and P2015 containing float values. We want to
    9·1 answer
  • What is the suffix of hollow?
    7·1 answer
  • Write an alogrithm to display the first ten even numbers​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!