why ‘illegal contract’ is a contradiction in terms?

Answers

Answer 1

Answer:

An Illegal contract or agreement is a contraction in terms when a contract is a legal obligation, illegal contract is viewed as a contradiction in terms.

Explanation:

Solution

An Illegal contract is called a contradiction for the following reasons listed below:

When a contract has a term that is obligatory, it is called a legal contract.

According to the rules of terms, when a contract is not done legally, it is considered an illegal contract.

On the common law of a contract or agreement, when a court does not apply or impose in any case or otherwise for a contract, it is seen as illegal.


Related Questions

Again, consider what you believe to be the goal of performing a penetration test. Why would you worry about doing any privilege escalation or leaving backdoors? What circumstances would cause you to do either of those things? Do you consider this to be practical or theoretical knowledge in light of your beliefs about penetration testing?

Answers

Answer:

Penetration monitoring is conducted based on the vulnerability evaluation (Were a susceptibility evaluated and mentioned).

Explanation:

Penetration Test

Penetration testing is carried out from both within (the network or application) as well as outside that aims to gain access to the system to evaluate if any suspicious activity or improper behavior is likely within the device. When there are some other potential security vulnerabilities, they are all found in the integration check that involves vulnerability assessment for frameworks and checking for network management. Automation of penetration testing is used to make it work better. Penetration monitoring deals with the same risk evaluation correlated with a disadvantage.

Privilege escalation

They need to think about known vulnerabilities as the system for network management works conditional on the privilege rates. Such that, increasing user has an article has highlighted and the consumer is only allowed to control or use the resources that should be used appropriately, depending on the level of privilege. If he gets elevated access then it will be a failure to have access control mechanism.

Leaving backdoors

The creator uses backdoors to test the system's functionality during the designing processes. The loophole can be a workaround overriding the identification for all users, or a default password. They would need to worry about leaving the backdoor because the backdoor.which is performed either deliberately or involuntarily will circumvent the entire security mechanism. During the intrusion testing process, the both privilege increase and the escape from the gateway can be discovered due to the research being done both inside and outside the device. The tester's testing phase acts as various users so that any destabilization of access may be found. The tester will use all numerous methods to supersede the technique of official approval, but when there are certain backdoors, maybe he can start by pointing that out.

In this warm up project, you are asked to write a C++ program proj1.cpp that lets the user or the computer play a guessing game. The computer randomly picks a number in between 1 and 100, and then for each guess the user or computer makes, the computer informs the user whether the guess was too high or too low. The program should start a new guessing game when the correct number is selected to end this run (see the sample run below).

Check this example and see how to use functions srand(), time() and rand() to generate the random number by computer.

Example of generating and using random numbers:

#include
#include // srand and rand functions
#include // time function
using namespace std;

int main()
{
const int C = 10;

int x;
srand(unsigned(time(NULL))); // set different seeds to make sure each run of this program will generate different random numbers
x = ( rand() % C);
cout << x << endl;
x = ( rand() % C ); // generate a random integer between 0 and C-1
cout << x << endl;
return 0;
}
*********************************************

Here is a sample run of the program:

Would you like to (p)lay or watch the (c)omputer play?

p

Enter your guess in between 1 and 100.

45

Sorry, your guess is too low, try again.

Enter your guess in between 1 and 100.

58

Sorry, your guess is too low, try again.

Enter your guess in between 1 and 100.

78

Sorry, your guess is too high, try again.

Enter your guess in between 1 and 100.

67

Sorry, your guess is too low, try again.

Enter your guess in between 1 and 100.

70

Sorry, your guess is too high, try again.

Enter your guess in between 1 and 100.

68

Sorry, your guess is too low, try again.

Enter your guess in between 1 and 100.

69

Congrats, you guessed the correct number, 69.

Would you like to (p)lay or watch the (c)omputer play or (q)uit?

c

The computer's guess is 50.

Sorry, your guess is too high, try again.

The computer's guess is 25.

Sorry, your guess is too high, try again.

The computer's guess is 13.

Sorry, your guess is too low, try again.

The computer's guess is 19.

Sorry, your guess is too high, try again.

The computer's guess is 16.

Sorry, your guess is too low, try again.

The computer's guess is 17.

Congrats, you guessed the correct number, 17.

Would you like to (p)lay or watch the (c)omputer play or (q)uit?

q

Press any key to continue

*****************************************************

So far I was able to create the user input ortion of the program, I need help coding the computer generated guessing game,

if the users input choice of computer at the end or choice of play.. if you could help me build on what I have below greatly appreciate it!!! thank you

code I have got so far:

#include
#include
#include

int main(void) {
srand(time(NULL)); // To not have the same numbers over and over again.

while(true) { // Main loop.
// Initialize and allocate.
int number = rand() % 99 + 2; // System number is stored in here.
int guess; // User guess is stored in here.
int tries = 0; // Number of tries is stored here.
char answer; // User answer to question is stored here.

//std::cout << number << "\n"; // Was used for debug...

while(true) { // Get user number loop.
// Get number.
std::cout << "Enter a number between 1 and 100 (" << 20 - tries << " tries left): ";
std::cin >> guess;
std::cin.ignore();

// Check is tries are taken up.
if(tries >= 20) {
break;
}

// Check number.
if(guess > number) {
std::cout << "Too high! Try again.\n";
} else if(guess < number) {
std::cout << "Too low! Try again.\n";
} else {
break;
}

// If not number, increment tries.
tries++;
}

// Check for tries.
if(tries >= 20) {
std::cout << "You ran out of tries!\n\n";
} else {
// Or, user won.
std::cout<<"Congratulations!! " << std::endl;
std::cout<<"You got the right number in " << tries << " tries!\n";
}

while(true) { // Loop to ask user is he/she would like to play again.
// Get user response.
std::cout << "Would you like to play again (Y/N)? ";
std::cin >> answer;
std::cin.ignore();

// Check if proper response.
if(answer == 'n' || answer == 'N' || answer == 'y' || answer == 'Y') {
break;
} else {
std::cout << "Please enter \'Y\' or \'N\'...\n";
}
}

// Check user's input and run again or exit;
if(answer == 'n' || answer == 'N') {
std::cout << "Thank you for playing!";
break;
} else {
std::cout << "\n\n\n";
}
}

// Safely exit.
std::cout << "\n\nEnter anything to exit. . . ";
std::cin.ignore();
return 0;
}

Answers

Answer:

A C++ program was used for a user or the computer play a guessing game.

Explanation:

The C++ code to this question:

#include <iostream>

#include <cstdlib> // srand and rand functions

#include <ctime> // time function

using namespace std;

int main()

{

const int C = 100;// constant integer with defined value 100

char type;// type of option chosen

cout<<"Would you like to (p)lay or watch the (c)omputer play?"<<endl;

cin>>type;// input of type

do{// for first iteration you can't choose q

int x;

srand(unsigned(time(NULL))); // set different seeds to make sure each run of this program will generate different random numbers

x = ( rand() % C);

x++;// random value between 1 and 100

int check=-1;// make initial check=-1

int ends=C;// for type selected as c, make the initial guess to be chosen from 1 to 100

int start=1;

while(1)

{

if(type=='p')// if selected type is p

{

cout<<"Enter your guess in between 1 and 100."<<endl;

cin>>check;

}

else if(type=='c')// if selected type is c

{

check=start+(rand()%(ends-(start-1)));//get a random number between updated start and ends for computer guessing

cout<<"The computer's guess is "<<(check)<<"."<<endl;

}

else// if type is not equal to c or p or q

{

cout<<"Invalid option chosen"<<endl;

break;

}  

if(check>x)// if the guess is greater

{

cout<<"Sorry, your guess is too high, try again."<<endl;

ends=check-1;// update ends in case type is c

}

else if(check<x)

{

cout<<"Sorry, your guess is too low, try again."<<endl;

start=check+1;// update start

}

else// if right number is selected

{

cout<<"Congrats, you guessed the correct number, "<<x<<"."<<endl;

break;

}

}

cout<<"Would you like to (p)lay or watch the (c)omputer play or (q)uit?"<<endl;

cin>>type;

}while(type!='q');

return 0;

}

Note: Kindly find an attached copy of the screenshot of execution of code below

Write a program which increments from 0 to 20 and display results in Decimal on the console 2-b) Modify above program to increment from 0 to 20 and display results in Binary on the console

Answers

Answer:

This program is written in C++

Comment are used to explain difficult lines

The first program that prints 0 to 20 (in decimal) starts here

#include<iostream>

int main()

{

//Print From 0 to 20

for(int i = 0;i<21;i++)

{

 std::cout<<i<<'\n';

}

}

The modified program to print 0 to 20 in hexadecimal starts here

#include<iostream>

using namespace std;

int main()

{

//Declare variables to use in conversion;

int tempvar, i=1,remain;

//Declare a char array of length 50 to hold result

char result[50];

//Print 0

cout<<"0"<<endl;

// Iterate from 1 to 20

for(int digit = 1; digit<21; digit++)

{

//Start Conversion Process

//Initialize tempvar to digit (1 to 20)

tempvar = digit;

while(tempvar!=0)

{

//Divide tempvar by 16 and get remainder

remain = tempvar%16;

if(remain<10)

{

 result[i++]=remain + 48;

}

else

{

 result[i++] = remain + 55;

}

//Get new value of tempvar by dividing it by 16

tempvar/=16;

}

//Print result

for(int l=i-1;l>0;l--)

{

cout<<result[l];

}

i=1;

cout<<endl;  

}

return 0;

}

//The Program Ends Here

See Attachments for program 1 and 2; program 2 is the modified version of 1

What will happen if registers are excluding the address register (Memory Address Register - MAR)?​

Answers

Answer: Memory address register captures and stores the memory address in CPU.

Explanation:

It stores the address of the data which is required to be sent and stored to specific location of the computer.It stores the next address of the data to be stored read or written.

If the memory address register is excluded in the system then the storage of memory will be compromised.

Computer has many functions. MAR is known to have the memory location of data that one needs to be accessed and if it is excluded, there is a compromise and one cannot get the data needed as it will be inaccessible.

What is the Memory Address Register?In a computer, the Memory Address Register (MAR) is known to be the CPU register that often stores the memory address through which one can get data to the CPU.

It is also known as the address to which data is often sent to or stored. That is, MAR has the power  to the memory location of data that one needs to be accessed.

Learn more about Memory Address Register from

https://brainly.com/question/24368373

Perform algorithm time measurement for all three quadratic sorting algorithms for Best Case (already sorted), Average Case (randomly generated), and Worst Case (inverse sorted) inputs and compare them with O(N*logN) sorting algorithm using Arrays.sort() method. Use arrays sizes of 50K, 100K, and 200K to produce timing results.

Answers

Answer:

Experiment size : 50,000

==================================

Selection sort :

---------------------------------------------------------

Worst case : 0.162

Average case : 0.116

Best case : 0.080

Insertion sort :

---------------------------------------------------------

Worst case : 0.162

Average case : 0.116

Best case : 0.080

Bubble sort:

--------------------------------------------------------

Worst case : 0.211

Average case : 0.154

Best case : 0.117

Experiment size : 100,000

==================================

Selection sort :

---------------------------------------------------------

Worst case : 0.316

Average case : 0.317

Best case : 0.316

Insertion sort :

---------------------------------------------------------

Worst case : 0.316

Average case : 0.317

Best case : 0.316

Bubble sort:

--------------------------------------------------------

Worst case : 0.482

Average case: 0.487

Best case : 0.480.

Experiment size : 200,000

==================================

Selection sort :

---------------------------------------------------------

Worst case : 1.254

Average case : 1.246

Best case : 1.259

Insertion sort :

---------------------------------------------------------

Worst case : 1.254

Average case : 1.246

Best case : 1.259

Bubble sort:

--------------------------------------------------------

Worst case : 1.990

Average case : 2.009.

Best case : 1.950

Explanation:

[NB: since it is very long there is the need for me to put it it a document form. Kindly check the doc. Files. The file A is the sort Analysis.Java file and the file B is the sort.Java file].

The concept of algorithm time measurement strictly depends on the following;

=> The measurement of time, space or energy on different sizes.

=> Plotting of the measurements and characterizing them.

=> Running or implementation of the algorithm.

Programming language such as Java can be used in accessing the operating system clock and Java had two static methods.

KINDLY CHECK BELOW FOR THE ATTACHMENT.

Complete method printPopcornTime(), with int parameter bagOunces, and void return type. If bagOunces is less than 2, print "Too small". If greater than 10, print "Too large". Otherwise, compute and print 6 * bagOunces followed by "seconds". End with a newline. Example output for ounces = 7: 42 seconds
code:
import java.util.Scanner;
public class PopcornTimer {
public static void printPopcornTime(int bagOunces) {
/* Your solution goes here */
}
public static void main (String [] args) {
printPopcornTime(7);
}
}

Answers

Answer:

if(bagOunces < 2){

      System.out.println("Too small");

  }

  else if(bagOunces > 10){

      System.out.println("Too large");

  }

  else{

      System.out.println(6*bagOunces+" seconds");

  }

Explanation:

The missing code segment is an illustration of conditional statements.

Conditional statements are used to execute statements depending on the truth value of the condition.

The missing code segment, where comments are used to explain each line is as follows:

//If bagOunces is less than 2

if(bagOunces < 2){

//This prints "Too small"

     System.out.println("Too small");  

 }

//If bagOunces is greater than 10

 else if(bagOunces > 10){

//This prints "Too large"

     System.out.println("Too large");  

 }

//Otherwise

 else{

//This calculates and prints the popcorn time

     System.out.println(6*bagOunces+" seconds");

}

Read more about similar programs at:

https://brainly.com/question/7253053

For this assignment, you will be writing a Deque ADT (i.e., LastnameDeque). A deque is closely related to a queue - the name deque stands for "double-ended queue." The dierence between the two is that with a deque, you can insert, remove, or view, from either end of the structure. Attached to this assignment are the two source les to get you started:

Answers

Answer:

Explanation:

The objective here is write a Deque ADT code by using Deque.java - the Deque interface; (i.e the specification we must implement) and BaseDeque.java which is  the driver for Deque testing.

For the computation of the code and its output I have written them in a word document due its long array which is much more than the 5000 character  this answer box can accommodate.

SEE THE ATTACHED FILE BELOW.

Using a C# program write a program that accepts any number of homework scores ranging in value from 0 through
10. Prompt the user for a new score if they enter a value outside of the specified range. Prompt
the user for a new value if they enter an alphabetic character. Store the values in an array.
Calculate the average excluding the lowest and highest scores. Display the average as well as the
highest and lowest scores that were discarded.

Answers

Answer:

The program is written using C# Console

Comments are used for explanatory purpose

Program starts here

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

namespace ConsoleApplication1

{

   class Program

   {

       static void Main(string[] args)

       {

           int num;

           Console.WriteLine("Enter digit: [0-10]");

           while (!int.TryParse(Console.ReadLine(), out num) || num<0||num>10)

           {

               Console.WriteLine("That was invalid. Enter a valid digit.");

           }

           //Declare scores

           int[] scores = new int[num];

           //Accept Input

           for(int i =0;i<num;i++)

           {

               Console.WriteLine("Enter Test Score "+(i+1));

               while (!int.TryParse(Console.ReadLine(), out scores[i]))

               {

                   Console.WriteLine("That was invalid. Enter a valid digit.");

                   Console.WriteLine("Enter Test Score " + (i + 1));

               }

           }

           //Determine highest

           int max = scores[0];

           for (int i = 1; i < num; i++)

           {

               if (scores[i] > max)

               {

                   max = scores[i];

               }

           }

           //Determine Lowest

           int least = scores[0];

           for (int i = 1; i < num; i++)

           {

               if (scores[i] < least)

               {

                   least = scores[i];

               }

           }

           int sum = 0;

           //Calculate total

           for(int i =0; i< num;i++)

           {

               sum += scores[i];

           }

           //Subtract highest and least values

           sum = sum - least - max;

           //Calculate average

           double average = sum / (num - 2);

           //Print Average

           Console.WriteLine("Average = "+average);

           //Print Highest

           Console.WriteLine("Highest = " + max);

           //Print Lowest

           Console.WriteLine("Lowest = " + least);

           Console.ReadLine();  

       }

   }

}

See Attachment for program source file in txt

Write down the result of each expression in the output column and specify the datatype of the result.Datatype should follow the Java Standards. If the output is a String, surround it with " ";if the output is char surround it with ‘ ’. Floats should have an ‘f’ or ‘F’ at the end, longs should have an ‘L’ or ‘l’ at the end (generally avoid using lowercase ‘l’ because it can be confusing).

Answers

Answer:

Kindly check the explanation section.

Explanation:

Below are the expression given in the question and the corresponding output and Datatype.

(1). Expression = 7/2 + 9.2/2.

Output = 7.6, Datatype = double

(2). Expression = 3.4 + 2 5 f.

Output = 5.9, Datatype = double.

(3). Expression = "whale" . Substring (2,5).

Output = "ale" , Datatype = string.

(4). Expression= (int) 9.2 + 6.0 f.

Output = 15.0 f, Datatype = float.

(5). Expression = (2 <= 1) && (5! = 2) || (8 + 5!= 13).

Output = false, Datatype = boolean

(6) Expression =1.5 f == 1.5?.

Output: “false” , Datatype : “true ”

Output = “false”,

Datatype= String.

(7). Expression = “joey”.charAtt(4).

Output = error, Datatype = error“.

(8). Expression = madmax”.

indexOf(“a”) + 7.

Output: 8 , Datatype = int.

(9). Expression = 2 + 3 + “catdog” + 1 + 2.

Output = “5catdog12”, Datatype = String.

(10). Expression = String.format(“%3.3f”,7.89672).

output = “7.897”, datatype = String.

(11). Expression = “captain”.indexOf(“a”, 2).

Output = 4, datatype = int.

(12). true ? ++3: 3++.

Output = error, dataty = error.

(13). Expression = new String[]{“tony”,“josh”}[0].

Output = “tony”, Datatype = String.

(14). Expression = “patrick”.substring(2) +“lucky”.substring(4).

Output = “tricky”, Datatype = String.

(15). Expression = “popFizz”.indexOf(“o”) + 2.4+ 6L.

Output9.4, Datatype = double.

(16). Expression = “pizza”.indexOf(“z”).

Output = 2, Datatype = int.

A standard science experiment is to drop a ball and see how high it bounces. Once the bounciness of the ball has been determined, the ratio gives a bounciness index. For example, if a ball dropped from a height of 10 feet bounces 6 feet high, the index is 0.6 and the total distance traveled by the ball is 16 feet after one bounce. If the ball were to continue bouncing, the distance after two bounces would be 10 ft 6 ft 6 ft 3.6 ft. Note that the distance traveled for each successive bounce is the distance to the floor plus 0.6 of that distance as the ball comes back up.
Write a program that lets the user enter the initial height from which the ball is dropped, the bounciness index, and the number of times the ball is allowed to continue bouncing. Output should be the total distance traveled by the ball.
Below is an example of the program input and output:
Enter the height from which the ball is dropped: 25
Enter the bounciness index of the ball: .5
Enter the number of times the ball is allowed to continue bouncing: 3

Answers

Answer:

Explanation:

height = float(input('Enter the height from which the ball is dropped: '))

bounci_index = float(input('Enter the bounciness index of the ball: '))

bounces = int(input('Enter the number of times the ball is allowed to continue bouncing: '))

distance = height

for i in range(bounces-1):

   height *= bounci_index

   distance += 2*height

distance += height*bounci_index

print('\nTotal distance traveled is: ' + str(distance) + ' units.')

Which statement most aptly defines the term networking?

Answers

Answer: We need more info.

Explanation:

Rachel wants to use Microsoft Query to retrieve data from her corporate databases and files so that she doesn't have to retype the data that she wants to analyze in Excel. To do so, she can click and/or enter the following information in the following series of clicks: Data tab > Get External Data group > From Other Sources > From Microsoft Query > Databases tab (To specify a data source for a database, text file, or Excel workbook) > OK > Create New Data Source dialog box > Type a name to identify the data source > Click a driver for the type of database for use as data source > Connect (Provide the information needed to connect to the data source) > OK.
1. True
2. False

Answers

Answer:

Option: True

Explanation:

Microsoft Query can be used to retrieve data from external source such as databases. There are lots of databases or data sources which are accessible such as Microsoft Access, Microsoft Excel, Microsfot SQL Server OLAP Services, Oracle, Paradox, text file etc.

The steps mentioned in the question are correct. After finishing all the steps, user shall see the name of the data source will appears in the Choose Data Source dialog box.

Rachel can use Microsoft Query to retrieve data from her corporate databases and files by using the aforementioned steps in Microsoft Excel: 1. True.

A database can be defined as a structured (organized) collection of data that are stored on a computer system and are usually accessed in various ways such as electronically.

Microsoft Query is a visual technique in Microsoft Excel that uses a data source to connect to an external database while showing end users the data that are available based on the following criteria:

A text string.Name of the data source.A driver for the type of database to be accessed.A default table for the data source.

In order for Rachel to retrieve data from her corporate databases and files, she should use Microsoft Query in Microsoft Excel while following these steps:

1. Click on Data tab.

2. Click on Get External Data group.

3. Select other Other Sources and then click on From Microsoft Query.

4. A dialog box opens, specify the data source for a database.

5. Click on OK.

6. Create a New Data Source.

7. Click on connect and OK after creating a New Data Source.

Read more: https://brainly.com/question/23388493

what are business rules​

Answers

Answer:

defines or constrains some aspect of business and always resolves to either true or false. It specifically involves terms, facts and rules

Explanation:

The goal of this exercise is to determine whether the following system specifications are consistent: If the file system is not locked, then new messages will be queued. If the file system is not locked, then the system is functioning normally, and conversely. If new messages are not queued, then they will be sent to the message buffer. If the file system is not locked, then new messages will be sent to the message buffer. New messages will not be sent to the message buffer.

Answers

Answer:

The following specifications are consistent

Explanation:

The file system  is locked ⇒ L

New messages will be queued ⇒ Q

The system is functioning normally ⇒ N

The message will be sent to the message buffer ⇒ B

" Now, let us rewrite the specifications"

"If the file system is not locked, then new messages will be queued" ∴ ¬L ⇒ Q

"If the system is not locked, then the system is functioning  normally and conversely" ∴ ¬L ⇔ N

"If new messages are not queued, then they will be sent to the message buffer" ∴ ¬Q ⇒ B

"If the file system is not locked, then new messages will be sent to the message buffer" ∴ ¬L ⇒ B

"New messages will not be sent to the message buffer" ∴ ¬B

To get consistency, take N to be false such that ¬N is true.

This mean that both L and Q be true, by the two conditional statements that have N as consequence.

First conditional statement ¬L ⇒ Q is of the form F?T, which is true.

Finally, the ¬L ⇒ B can be satisfied by taking B to be false.

This means that this set of specifications is consistent!

Truth value assignment

B: False

N: False

Q: True

L: True

Observing the Specification, Condition and Truth Value, it is evident that they are consistent.

productivity is the combination of

Answers

Answer:

Productivity is the combination of efficiency and effectiveness.

Explanation:

IF 2+2=4 AND 5+5 IS 10 __________

Answers

Answer:

8+8=16?

Explanation:

Answer:

Then 11+11 IS 22

Explanation:

Using the "split" string method from the preceding lesson, complete the get_word function to return the {n}th word from a passed sentence. For example, get_word("This is a lesson about lists", 4) should return "lesson", which is the 4th word in this sentence. Hint: remember that list indexes start at 0, not 1.
def get_word(sentence, n):
# Only proceed if n is positive
if n > 0:
words = ___
# Only proceed if n is not more than the number of words
if n <= len(words):
return(___)
return("")
print(get_word("This is a lesson about lists", 4)) # Should print: lesson
print(get_word("This is a lesson about lists", -4)) # Nothing
print(get_word("Now we are cooking!", 1)) # Should print: Now
print(get_word("Now we are cooking!", 5)) # Nothing

Answers

Answer:

def get_word(sentence, n):

# Only proceed if n is positive

   if n > 0:

       words = sentence.split()

# Only proceed if n is not more than the number of words

       if n <= len(words):

           return words[n-1]

   return (" ")

print(get_word("This is a lesson about lists", 4)) # Should print: lesson

print(get_word("This is a lesson about lists", -4)) # Nothing

print(get_word("Now we are cooking!", 1)) # Should print: Now

print(get_word("Now we are cooking!", 5)) # Nothing

Explanation:

Added parts are highlighted.

If n is greater than 0, split the given sentence using split method and set it to the words.

If n is not more than the number of words, return the (n-1)th index of the words. Since the index starts at 0, (n-1)th index corresponds to the nth word

The required function to obtain the nth word of a sentence is stated below :

def get_word(sentence, n):

# Only proceed if n is positive

if n > 0 :

words = sentence.split()

# Only proceed if n is not more than the number of words

if n <= len(words) :

return words[n-1]

return("")

The split function allows strings to be broken down or seperated into distinct parts based on a stated delimiter or seperator such as (comma(,), hypen(-), whitespace) and so on.

In programming indexing starts from 0, hence, the first value is treated as being in position 0.

To obtain value 4th word in a sentence, it will be regarded as being in position 3.

To split the words in the sentence above, the string will be split based on whitespace(space in between each word).

By default this can be achieved without passing any argument to the split method.

That is ; str.split()

print(get_word("This is a lesson about lists", 4))

#This will print lesson (position 3) counting from 0

print(get_word("This is a lesson about lists", -4))

# This won't print anything as it does not meet the first if condition

print(get_word("Now we are cooking!", 1))

#This will print Now(position 0) counting from 0.

print(get_word("Now we are cooking!", 5))

#This won't print anything as it does not meet the second if condition (n is more than the number of words in the sentence(4)

Learn more : https://brainly.com/question/17615351

3. (20 points) Write a C++ recursive function that finds the maximum value in an array (or vector) of integers without using any loops. (a) Test your function using different input arrays. Include the code. i. ii. (b) Write a recurrence relation that represents your algorithm. i. T(n) = T(n-1) + O(1) (c) Solve the recurrence relation and obtain the running time of the algorithm in Big-O notation.

Answers

Answer:

Following are the code to this question:

In option (i):

#include <iostream>//defining header file

using namespace std;

int findMax(int B[], int x)//defining recursive method findMax

{

if (x == 1)//defining condition when value of n==1

return B[0];//return array first element

return max(B[x-1], findMax(B, x-1)); // calling recursive method inside max method and return value

}

int main() //defining main method  

{

int B[] = {12, 24, 55, 60, 50, 30, 29};//defining array B

int x= 7;//defining integer variable and assign a value

cout << "Maximum element value of the array is: "<<findMax(B, x)<<endl;//calling method findMax and print value

return 0;

}

Output:

Maximum element value of the array is: 60

In option (ii):

[tex]\Rightarrow \ T(n) = 1 + T(n-1)\\\Rightarrow 1 + 1 + T(n-2)\\ \Rightarrow 1 + 1 + 1 + ... n \ times \\\Rightarrow O(n) \\[/tex]

Explanation:

In the above-given program a recursive method "findMax" is defined, which accepts an array "B" and an integer variable "n" in its parameter, inside the method a conditional statement is used that, checks value of x equal to 1.

If the above condition is true it will return the first element of the array and find the max number. Inside the main method, an array B is declared that assigns some values and an integer variable is declared, that also assigns some values, in the last step print method is used that pass value in method and prints its return value. In the option (ii) we calculate the Big-O notation algorithm value.

Which of the following sorting algorithms could be implemented on a doubly-linked list WITHOUT making the asymptotic worst-case complexity even worse? You must perform the sorting in-place, you CANNOT just copy to an array and then use the normal algorithm

I. Bubble sort
Il. Selection sort
IlI. Insertion sort
IV. Quicksort
V. Heapsort

A. I, II, and IlIl only
B. IV and V only
C. I and II only
D. Iand Il only
E. All except V

Answers

Answer:

C. I and II only

Explanation:

Doubly-linked list is used for sorting algorithms. To sort doubly-linked lists first sort the nodes current and nodes index then compare the data of current and index node. Bubble sort and Selection sort can be used for algorithm sorting without asymptotic complexity. Bubble sort can be created when adjacent nodes are in ascending order.

Which are strategies for communicating solutions that include flowcharts? Choose all that apply.

breaking the solution into steps

diagramming the solution

modeling the solution

writing the algorithm

Answers

Answer:

The answer is C

Explanation:

Answer:

B and C

Explanation:

Define a structure with the tag Consumption to consist of a character array (city[20]), an integer (year), and a double (usage). b) Define a structure with the tag Resource to consist of two character arrays (material [30], and units[20]), and three doubles (longitude, latitude, and quantity). Then in the main function, declare metal and fuel to be variables of type struct Resource, and then declare water and power to be variables of type struct Consumption.

Answers

Answer:

..............................................................................

...............................

Explanation:

..............................................................................................................................................

Case 4-1 Santo is creating a company newsletter for his architectural firm. He has solicited contributions from his colleagues on their current projects, and several people have provided photos of homes and businesses they are currently remodeling. Santo is about to begin compiling all the information using desktop publishing in Microsoft Word. Santo wants to use most of the graphics his colleagues asked to display with their articles, but his file size has become unmanageable with so many sketches and photos. Santo might be able to reduce his document file size without leaving out content by _______.

Answers

Answer:

Saving all graphics as JPEG files

Explanation:

A JPEG file can be defined as the way in which images ,graphics or photos are been stored after the compression of the images has occured because compression of images help to reduce the quality of the image thereby creating more available space.

Since Santo file size has become unmanageable with so many sketches and photos the best alternative for him is to Save all the graphics as JPEG files which will enable him to have extra space because JPEG files will enable the compression of those images by reducing the quality of the image without leaving out any content.

Your solution should for this assignment should consist of five (5)files:============================================== FuelGauge.h (class specification file)FuelGauge.cpp (class implementation file)Odometer.h (class specification file)Odometer.cpp (class implementation file)200_assign6.cpp (application program)=================================================★ For your sixth programming assignment, you will be implementing a program that uses two(2)classes that work together to simulate a car’s fuel gauge and odometer. The classes you will design are: TheFuelGaugeClass: This class will simulate a fuel gauge. Its responsibilities are↘To know the car’s current amount of fuel, in gallons.↘To report the car’s current amount of fuel, in gallons.↘To be able to increment the amount of fuel by 1 gallon. This simulates putting fuel in the car. (The car can hold a maximum of 15 gallons)↘To be able to decrement the amount of fuel by 1 gallon, if the amount of fuel is greater than 0 gallons. This simulates burning fuel as the car runs.TheOdometerClass: This class will simulate the car’s odometer. Its responsibilities are:↘To know the car’s current mileage.↘To report the car’s current mileage.↘To be able to increment the current mileage by 1 mile. The maximum mileage the odometer can store is 999,999 miles. When this amount is execeeded, the odometer resets the current mileage to 0.↘To be able to work with aFuelGaugeobject. It should decrease theFuelGaugeobject’s current amount of fuel by 1 gallon for every 24 miles traveled. (The car’s fuel economy is 24 miles per gallon)The FuelGaugeclass should have at least one constructor, and the appropriate member functions to get the number of gallons, increment the number of gallons, and decrement the number of gallons.★ The odometer class should have at least one constructor, and the appropriate member functions to get the mileage and increment the mileage (unfortunately you cannot decrement the mileage!).★ In the odometer class, you can have a member variable that is a pointer to a FuelGauge object. This is how you can establish a relationship between the two classes that allow them to work together. For every mile the car is driven, the odometer is increased by 1, and for every 24 miles the car is driven, the number of gallons is reduced by one.★ So in the Odometer class, one of the private member variables should be of type fuel gauge* (pointer to a FuelGauge object).★ Demonstrate the two classes by creating instances(objects)of each. Simulate filling the car up with fuel, and then run a loop that increments the odometer until the car runs out of fuel. During each loop iteration, print the car’s current mileage and amount of fuel.

Answers

Answer: provided in the explanation section

Explanation:

This was implemented in C++

Filename: Car.cpp

#include <iostream>

#include <iomanip>

#include <cstdlib>

#include "Odometer.h"

using namespace std;

int main()

{

  char response;

  do

  {

      FuelGuage* myFuel = new FuelGuage(6);

      int fuelLevel = myFuel->getFuel();

      cout << "Car gas level: " << fuelLevel << endl;

      cout << "Car is filling up" << endl;

      while(myFuel->getFuel() < 15)

      {

          myFuel->addFuel();

      }

      Odometer* car = new Odometer(myFuel, 999990);

      cout << "Car gas level: " << car->getFuelGuage()->getFuel() << endl;

      cout << "Car is off!" << endl;

      cout << "--------------------------" << endl;

      while(car->getFuelGuage()->getFuel() > 0)

      {

          car->addMile();

          int miles = car->getMileage();

          cout << "Mileage: " << setw(6) << miles << ", Fuel Level: " << car->getFuelGuage()->getFuel() << endl;

          cout<<"--------------------------------------------------------------"<<endl;

      }

      delete myFuel;

      delete car;

      cout << "Would you like to run the car again(Y/N)? ";

      cin >> response;

      system("cls||clear");

  } while(toupper(response) != 'N');

  return 0;

}

Filename: FuelGuage.cpp

#include "FuelGuage.h"

FuelGuage::FuelGuage()

{

  init();

}

FuelGuage::FuelGuage(int fuel)

{

  init();

  this->fuel = fuel;

}

FuelGuage::FuelGuage(const FuelGuage& copy)

{

  this->fuel = copy.fuel;

}

void FuelGuage::init()

{

  this->fuel = 0;

}

int FuelGuage::getFuel()

{

  return fuel;

}

void FuelGuage::addFuel()

{

  fuel++;

}

void FuelGuage::burnFuel()

{

  fuel--;

}

Filename:FuelGuage.h

#ifndef FUEL_GUAGE_H

#define FUEL_GUAGE_H

class FuelGuage

{

private:

  int fuel;

  void init();

public:

  FuelGuage();

  FuelGuage(int fuel);

  FuelGuage(const FuelGuage& copy);

  int getFuel();

  void addFuel();

  void burnFuel();

};

#endif

Filename : Odometer.cpp

#include "Odometer.h"

Odometer::Odometer()

{

  init();

}

Odometer::Odometer(FuelGuage* inFuel, int inMileage)

{

  init();

  this->fuel = new FuelGuage(*inFuel);

  this->mileage = inMileage;

  this->milesSinceAddingFuel = 0;

}

void Odometer::init()

{

  fuel = new FuelGuage();

  mileage = 0;

  milesSinceAddingFuel = 0;

}

FuelGuage* Odometer::getFuelGuage()

{

  return fuel;

}

int Odometer::getMileage()

{

  return mileage;

}

void Odometer::addMile()

{

  if(mileage < 999999)

  {

      mileage++;

      milesSinceAddingFuel++;

  }

  else

  {

      mileage = 0;

      milesSinceAddingFuel++;

  }

  if((milesSinceAddingFuel % 24) == 0)

  {

      fuel->burnFuel();

  }

}

void Odometer::resetMiles()

{

  milesSinceAddingFuel = 0;

}

Odometer::~Odometer()

{

  delete fuel;

}

Filename: Odometer.h

#ifndef ODOMETER_H

#define ODOMETER_H

#include "FuelGuage.h"

class Odometer

{

private:

  void init();

  int mileage;

  int milesSinceAddingFuel;

  FuelGuage* fuel;

public:

  Odometer();

  Odometer(FuelGuage* inFuel, int inMileage);

  FuelGuage* getFuelGuage();

  int getMileage();

  void addMile();

  void resetMiles();

  ~Odometer();

};

#endif

Consider the following recursive method, which is intended to return a String with any consecutive duplicate characters removed. For example, removeDupChars("aabcccd") returns "abcd".public static String removeDupChars(String str){if (str == null || str.length() <= 1){return str;}else if (str.substring(0, 1).equals(str.substring(1, 2))){return removeDupChars(str.substring(1));}else{/* missing code */}}Which of the following can replace /* missing code */ so that removeDupChars works as intended?A. return removeDupChars(str.substring(2));B. return removeDupChars(str.substring(1)) + str.substring(0, 1);C. return removeDupChars(str.substring(2)) + str.substring(1, 2);D. return str.substring(0, 1) + removeDupChars(str.substring(1));E. return str.substring(1, 2) + removeDupChars(str.substring(2));

Answers

Answer:

D. return str.substring(0, 1) + removeDupChars(str.substring(1));

Explanation:

The logic here is following:

If the there are consecutive duplicate characters, return the removeDupChars method. The parameter of the removeDupChars method is a string, but the duplicate of the first character is removed from the string. The else-if part of the program does this job.

If the consecutive characters are not duplicated, return the first character of the string and the removeDupChars method. The parameter of the removeDupChars method is the rest of the string characters. The else part of the program does this job.

When the length of the str becomes one (or when the str is null), the program reaches its base and returns the str. The if part of the program does this job.

A recursive function is that function that calls itself from within.

The code statement that can replace the comment /* missing code */ is (d) return str.substring(0, 1) + removeDupChars(str.substring(1));  

The function definition is given as:

removeDupChars(String str)

The function has 3 linked conditional statements, each of which perform three different functions.

The first works for a null string and single characterThe second and the third are to return the intended string for strings with multiple lengths.

For the third condition to work, the consecutive characters must not be duplicated.

So, the code statement that does this is (d) return str.substring(0, 1) + removeDupChars(str.substring(1));

Read more about recursive functions at:

https://brainly.com/question/25647517

Click/press _______ to remove the most recently typed text.

Answers

Answer:

ctrl Z

Explanation:

ctrl Z is the shortcut for undo it will reverse the last thing you did ctrl Y is redo if i accidently did ctrl Z i can do ctrl Y. Hope this helps!

In cell F29, use an IF function to display the correct Shipping Charge, based on the amount of the Discounted Total. If the Discounted Total is greater than or equal to the Free Shipping Minimum found in cell B28, the Shipping Charge is 0 (zero); otherwise, the Shipping Charge is 5% of the Discounted Total. Hint: You will need to use a formula for the Value if False to calculate what 5% of the Discounted Total will be.

Answers

Answer:

= IF(B29 >= B28,0,(0.05 * B29))

Explanation:

Given

Free Shipping Minimum = B28

Shipping Charge = F29

Required

Write a formula in F29 to calculate the total shipping charge based on the condition in the question.

To solve this, the following assumption needs to be made.

It'll be assumed that cell B29 contains the value for Discounted Total.

So,

Discounted Total = B29

The condition in the question says

1. If Discounted Total (B29) is greater than or equal to the Free Shipping Minimum (B29), then Shipping Charge (F29) is 0

This can be represented as

If(B29 >= B28)

F29 = 0

2. Else (i.e. if (1) above is false), Shipping Charge (F29) equals 5% of Discounted Total (B29)

This can also be represented as

F29 = 0.05 * B29

Writing the formula in (1) and (2) together in Excel format;

= IF(B29 >= B28, 0, (0.05 * B29))

The above formula will give the desired result based on the condition in the question.

Take for instance;

Free Shipping Minimum = B28 = 28

Discounted Total = B29 = 30

Since 30 >= 28, the value of F29 will be 0 because it satisfies condition 1.

But if

Free Shipping Minimum = B28 = 30

Discounted Total = B29 = 28

Since 28 < 30, the value of F29 will be 5% of 28 = 1.4 because it satisfies condition 2

Given class Triangle (in file Triangle.java), complete main() to read and set the base and height of triangle1 and of triangle2, determine which triangle's area is larger, and output that triangle's info, making use of Triangle's relevant methods. Ex: If the input is: 3.0 4.0 4.0 5.0 where 3.0 is triangle1's base, 4.0 is triangle1's height, 4.0 is triangle2's base, and 5.0 is triangle2's height, the output is: Triangle with larger area: Base: 4.00 Height: 5.00 Area: 10.00

Answers

Answer:

The Triangle.java file is not provided; However, the program is as follows;

Comments are used for explanatory purpose

Also see attachment for Triangle.java program file

import java.util.*;

public class triangle

{

public static void main(String [] args)

{

 Scanner input = new Scanner(System.in);

 //Declare variables

 double base1, height1, base2, height2;

 //Prompt user for inputs

 System.out.println("Provide values for the base and height of the two triangles");

 System.out.print("Base of Triangle 1: ");

 base1 = input.nextDouble();

 System.out.print("Height of Triangle 1: ");

 height1 = input.nextDouble();

 System.out.print("Base of Triangle 2: ");

 base2 = input.nextDouble();

 System.out.print("Height of Triangle 2: ");

 height2 = input.nextDouble();

 //Compare and Print Results

 if(0.5 *base1 * height1 > 0.5 * base2 * height2)

 {

  System.out.print("Triangle with larger area: Base: "+base1+" Height: "+height1+" Area: "+(0.5 * base1 * height1));

 }

 else

 {

  System.out.print("Triangle with larger area: Base: "+base2+" Height: "+height2+" Area: "+(0.5 * base2 * height2));

 }

}

}

What does this button mean in the computer ????????

Answers

Answer:

Context menu

Explanation:

If you want to open a context menu this is the one

Alternative is Shift+F10 in most applications to open a context menu. It's basically the same thing as the menu key

Answer:

Context Menu

Explanation:

this button mean in the computer

digital crate to miss meat​

Answers

Im sorry, this makes no sense. i think it is supposed to be an analogy, but i would need more info or background about the question

Answer:

Wait......What is the question or why did u put that??? I am so confused rn. lol

Explanation:

Write a method called allDigitsOdd that returns whether every digit of a positive integer is odd. Return true if the number consists entirely of odd digits (1, 3, 5, 7, 9) and false if any of its digits are even (0, 2, 4, 6, 8). For example, the call allDigitsOdd(135319) returns true but allDigitsOdd(9145293) returns false.

Answers

Answer:

Sample output:

Enter integer 3232423

true

Enter integer 12131231

false

Explanation:

Above is the output of the program and for the solution check the screenshots attach to understand clearly the program.

Thanks

Other Questions
Important changes in global trade in the 1990s were made by _____________. a. NAFTA and WTO. c. WTO and OPEC. b. NAFTA and OPEC. d. OPEC and the United Nations. Jalen combines two substances in science class. Once combined, only one of the two substancesis visible. When he placed this combination into a filter, substance 1 stayed in the filter whilesubstance 2 went through it. Which of the following claims regarding Jalen's combination is themost accurate?a. This combination is not a mixture because he cannot see one of the substances.b. The combination is a mixture because the substances can be separated.c. The combination is not a mixture because the substances can be separated.d. The combination is a mixture only because he cannot see one of the substances, The Mini-Case "Pay-for-Delay Agreements" states that some incumbent producers of drugs with expiring patents paid potential generic producers to delay entry into the market. Why were incumbents willing to offer enough to potential entrants to make them delay entry? How will the 2013 Supreme Court decision allowing potential legal action against the companies affect this calculation? Incumbents were willing to offer enough to potential entrants to make them delay their entry to A. increase market competition. B. eventually deter entry completely. C. charge a monopoly price. D. produce generic drugs. E. lower fixed costs. A potato was launched in the air using a potato gun. The function for the situation was h(t)=-16t^2 +100t+10, where t was the time in seconds and h is the height in ft. What was the maximum height? What was the lowest height of the potato? What was the lowest times that applies to the actual situation? What is the greatest time that applied to the situation? What are the domain and range of the function using set builder notation? a researcher creates two random samples, each with sample size of 12. he does not find a statically significant difference between the two groups. which of the following statements is correct? select all that apply a) since random samples were used, the conclusion b) the sample size does not impact results of statistical significance. c) since the sample size is small , the conclusion is likely to be untrue. d) since the sample size of each group is greater than 10, the conclusion is likely to be true A person can plow all driveways with four wheel drive trucking 3 hours.Using snow blade on lawn tractor neighbor plows same number driveway in 7 hours. How long would it take them to work together The triangles shown below must be congruent Write the condensed structural formula of the ester formed when each Of the following reacts with methanol. For example, the ester formed when propanoic acid (CH3CH2COOH) reacts With methanol (HOCH3) is CH3CH2COOCH3. a. acetic acid (CH3COOH)b. butanoic acid I need help with these please 3-6 if you can In which city did the residents of a ghetto stage a brave uprising in 1943? Use K to write an equation, y=kx, for the relationship. I need help I think I have the but I might be wrong Define a structure with the tag Consumption to consist of a character array (city[20]), an integer (year), and a double (usage). b) Define a structure with the tag Resource to consist of two character arrays (material [30], and units[20]), and three doubles (longitude, latitude, and quantity). Then in the main function, declare metal and fuel to be variables of type struct Resource, and then declare water and power to be variables of type struct Consumption. According to Madison, ratifying the Constitution would improve the economy by Brady and 3 friends went to lunch at Mazzios Pizza. Their meal cost $32, and they left a 15% tip. How much was the total bill, including tip? Can someone please explain it to me how to do it? What is the name for a nuclear particle that has about the same mass as a neutron, but with a positive charge?nuclideprotonelectronisotope. Cattle, horses, and sheep were introduced into Mexico by the: French Spanish Indians Dutch 1. A penny for your thoughts? If it's a 1943 copper penny, it could be worth as much as fiftythousand dollars. In 1943. most pennies were made out of steel since copper was needed forWorld War II, so the 1943 copper penny is ultra-rare. Another rarity is the 1955 double diepenny. These pennies were mistakenly donble stamped, so they have overlapping dates andletters. If it's uncirculated, it'd easily fetch $25.000 at an auction. Now that's a pretty penny.Summarize this paragraph in one sentence. Be specific and clearly explain the main idea.Main idea The augmented matrix below represents a system of equations. revious1NextPost Test: InvestingSubmit TestReader Tools1Select the correct answer from each drop-down menu.Identify the type of chart described and complete the sentence.Achart shows open and close prices and highs and lows, but over a long time period it can also show pricingResetNext