Translate each statement into a logical expression. Then negate the expression by adding a negation operation to the beginning of the expression. Apply De Morgan's law until each negation operation applies directly to a predicate and then translate the logical expression back into English.
Sample question: Some patient was given the placebo and the medication. ∃x (P(x) ∧ D(x)) Negation: ¬∃x (P(x) ∧ D(x)) Applying De Morgan's law: ∀x (¬P(x) ∨ ¬D(x)) English: Every patient was either not given the placebo or not given the medication (or both).(a) Every patient was given the medication.(b) Every patient was given the medication or the placebo or both.(c) There is a patient who took the medication and had migraines.(d) Every patient who took the placebo had migraines. (Hint: you will need to apply the conditional identity, p → q ≡ ¬p ∨ q.)

Answers

Answer 1

Answer:

Explanation:

To begin, i will like to break this down to its simplest form to make this as simple as possible.

Let us begin !

Here statement can be translated as: ∃x (P(x) ∧ M(x))

we require the Negation: ¬∃x (P(x) ∧ M(x))

De morgan's law can be stated as:

1) ¬(a ∧ b) = (¬a ∨ ¬b)

2) ¬(a v b) = (¬a ∧ ¬b)

Also, quantifiers are swapped.

Applying De Morgan's law, we have: ∀x (¬P(x) ∨ ¬M(x)) (∃ i swapped with ∀ and intersecion is replaced with union.)

This is the translation of above

English: Every patient was either not given the placebo or did not have migrane(or both).

cheers i hope this helped !!


Related Questions

Next, Su wants to explain how the cotton gin separated seeds from cotton. At first, she considers using star bullets for
the steps in this process. But then, she determines that is not the right approach. Which action would most clearly
show the steps in the process in her presentation?
Su should change the type of bullet.
Su should change the size of the bullets.
Su should change the bullets to numbers.
Su should change the color of the bullets.​

Answers

Answer:

change bullets to numbers

Explanation:

100%

In this challenge you will use the file regex_replace_challenge_student.py to:
Write a regular expression that will replace all occurrences of:
regular-expression
regular:expression
regular&expression
In the string: This is a string to search for a regular expression like regular expression or regular-expression or regular:expression or regular&expression
Assign the regular expression to a variable named pattern
Using the sub() method from the re package substitute all occurrences of the 'pattern' with 'substitution'
Assign the outcome of the sub() method to a variable called replace_result
Output to the console replace_results
Regular Expression Replace Challenge
The Python statement containing the string to search for the regular expression occurrence is below. search_string=’’’This is a string to search for a regular expression like regular expression or regular-expression or regular:expression or regular&expression’’’
Write a regular expression that will find all occurrences of:
a. regular expression
b. regular-expression
c. regular:expression
d. regular&expression in search_string
Assign the regular expression to a variable named pattern
The Python string below is used for substitution substitution="regular expression"
Using the sub() method from the re package substitute all occurrences of the ‘pattern’ with ‘substitution’
Assign the outcome of the sub() method to a variable called replace_result
Output to the console replace_results
import re
#The string to search for the regular expression occurrence (This is provided to the student)
search_string='''This is a string to search for a regular expression like regular expression or
regular-expression or regular:expression or regular&expression'''
#1. Write a regular expression that will find all occurrances of:
# a. regular expression
# b. regular-expression
# c. regular:expression
# d. regular&expression
# in search_string
#2. Assign the regular expression to a variable named pattern
#The string to use for subsitution (This is provided to the student)
substitution="regular expression"
#3. Using the sub() method from the re package substitute all occurrences of the 'pattern' with 'substitution'
#4. Assign the outcome of the sub() method to a variable called replace_result
#5. Output to the console replace_results

Answers

Answer:

Please follow the code indentation for the python program.

Explanation:

In this assignment you'll write a program that encrypts the alphabetic letters in a file using the Hill cipher where the Hill matrix can be any size from 2 x 2 up to 9 x 9. The program can be written using one of the following: C, C++, or Java. Your program will take two command line parameters containing the names of the file storing the encryption key and the file to be encrypted. The program must generate output to the console (terminal) screen as specified below.Command Line Parameters1. Your program compile and run from the command line.2. The program executable must be named "hillcipher" (all lowercase, no spaces or file extension).3. Input the required file names as command line parameters. Your program may NOT prompt the user to enter the file names. The first parameter must be the name of the encryption key file, as described below. The second parameter must be the name of the file to be encrypted, as also described below. The sample run command near the end of this document contains an example of how the parameters will be entered.4. Your program should open the two files, echo the input to the screen, make the necessary calculations, and then output the ciphertext to the console (terminal) screen in the format described below.Note: If the plaintext file to be encrypted doesn't have the proper number of alphabetic characters, pad the last block as necessary with the letter 'X'. It is necessary for us to do this so we can know what outputs to expect for our test inputs.

Answers

Answer: Provided in the explanation section

Explanation:

C++ Code

#include<iostream>

#include<fstream>

#include<string>

using namespace std;

// read plain text from file

void readPlaneText(char *file,char *txt,int &size){

  ifstream inp;

 

  inp.open(file);

 

  // index initialize to 0 for first character

 

  int index=0;

  char ch;

 

  if(!inp.fail()){

      // read each character from file  

      while(!inp.eof()){

          inp.get(ch);

          txt[index++]=ch;

      }

  }

 

  // size of message

  size=index-1;

}

// read key

int **readKey(char *file,int **key,int &size){

  ifstream ink;

 

  //

  ink.open(file);

      if(!ink.fail()){

         

          // read first line as size

      ink>>size;

     

      // create 2 d arry

      key=new int*[size];

     

      for(int i=0;i<size;i++){

          key[i]=new int[size];

      }

     

      // read data in 2d matrix

      for(int i=0;i<size;i++){

          for(int j=0;j<size;j++){

              ink>>key[i][j];

          }  

      }

  }

  return key;

}

// print message

void printText(string txt,char *msg,int size){

  cout<<txt<<":\n\n";

 

  for(int i=0;i<size;i++){

      cout<<msg[i];

  }

}

// print key

void printKey(int **key,int size){

  cout<<"\n\nKey matrix:\n\n";

  for(int i=0;i<size;i++){

      for(int j=0;j<size;j++){

          cout<<key[i][j]<<" ";

      }  

      cout<<endl;

  }

}

void encrypt(char *txt,int size,int **key,int kSize,char *ctxt){

  int *data=new int[kSize];

 

  for(int i=0;i<size;i=i+kSize){  

 

  // read key size concecutive data

      for(int a=0;a<kSize;a++){

          data[a]=txt[i+a]-'a';

      }

     

      // cipher operation

      for(int a=0;a<kSize;a++){

          int total=0;

          for(int b=0;b<kSize;b++){

              total+=key[a][b]*data[b];

          }  

          total=total%26;

          ctxt[i+a]=(char)('a'+total);

      }      

  }

}

int main(int argc,char **argv){

  char text[10000];

  char ctext[10000];

  int **key;

  int keySize;

  int size;

  // input

  key=readKey(argv[1],key,keySize);

  readPlaneText(argv[2],text,size);

  encrypt(text,size,key,keySize,ctext);

 

  // output

  printKey(key,keySize);

  cout<<endl<<endl;

  printText("Plaintext",text,size);

  cout<<endl<<endl;

  printText("Ciphertext",ctext,size);

 

  return 0;

}

cheers i hope this helped !!!

Create a program that asks the user to enter grade scores. Use a loop to request each score and add it to a total. Continue accepting scores until the user enters a negative value. Finally, calculate and display the average for the entered scores.

Answers

Answer:

total = 0

count = 0

while(True):

   grade = float(input("Enter a grade: "))

   if grade < 0:

       break

   else:

       total += grade

       count += 1

       

average = total/count

print("The average is: " + str(average))

Explanation:

*The code is in Python.

Initialize the total and count as 0

Create a while loop that iterates until a specific condition is met inside the loop

Inside the loop, ask the user to enter a grade. If the grade is smaller than 0, stop the loop. Otherwise, add the grade to the total and increment the count by 1.

When the loop is done, calculate the average, divide the total by count, and print it

Write a program in python that can compare the unit (perlb) cost of sugar sold in packages with different weights and prices. The program prompts the user to enter the weight and price of package 1, then does the same for package 2, and displays the results to indicate sugar in which package has a better price. It is assumed that the weight of all packages is measured in lb. The program should check to be sure that both the inputs of weight and price are both positive values.

Answers

Answer:

weight1 = float(input("Enter the weight of first package: "))

price1 = float(input("Enter the price of first package: "))

weight2 = float(input("Enter the weight of second package: "))

price2 = float(input("Enter the price of second package: "))

if weight1 > 0 and price1 > 0 and weight2 > 0 and price2 > 0:

   unit_cost1 = price1 / weight1

   unit_cost2 = price2 / weight2

   

   if unit_cost1 < unit_cost2:

       print("Package 1 has a better price.")

   else:

       print("Package 2 has a better price.")

else:

   print("All the entered values must be positive!")

Explanation:

*The code is in Python.

Ask the user to enter the weight and the price of the packages

Check if the all the values are greater than 0. If they are, calculate the unit price of the packages, divide the prices by weights. Then, compare the unit prices. The package with a smaller unit price has a better price.

If all the entered values are not greater than 0, print a warning message

What program is best for teaching young people code?

Answers

I’d probably say scratch, Its great for young people to learn how to code. Lots of things you can do and make with it.

Assume passwords are selected from four character combinations of 26 lower case alphabetic characters. Assume an adversary is able to attempt passwords at a rate of 1 per second. Assuming feedback to the adversary flagging an error as each incorrect character is entered, what is the expected time to discover the correct password

Answers

Answer:

Given:

Passwords are selected from 4 characters.

Character combinations are 26 lower case alphabetic characters.

Passwords attempts by adversary is at rate of 1 second.

To find:

Expected time to discover the correct password

Explanation:

Solution:

4 character combinations of 26 alphabetic characters at the rate of one attempt at every 1 second = 26 * 4 = 104

So 104 seconds is the time to discover the correct password. However this is the worst case scenario when adversary has to go through every possible combination. An average time or expected time to discover the correct password is:

13 * 4 = 52

You can also write it as 104 / 2 = 52 to discover the correct password. This is when at least half of the password attempts seem to be correct.

The Fast Freight Shipping Company charges the following rates for different package weights:
2 pounds or less: $1.50
over 2 pounds but not more than 6 pounds: $3.00
over 6 pounds but not more than 10 pounds: $4.00
over 10 pounds: $4.75
Write a program that asks the user to enter the weight of a package and then displays the shipping charges. The program should also do "Input Validation" that only takes positive input values and show a message "invalid input value!" otherwise.

Answers

Answer:

import java.util.Scanner;

public class ShippingCharge

{

   static double wt_2=1.50;

   static double wt_6=3;

   static double wt_10=4;

   static double wt_more=4.75;

   static double charge;

   static double weight;

public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);

   do

   {

 System.out.print("Enter the weight of the package: ");

 weight = sc.nextDouble();

 if(weight<=0)

     System.out.println("Invalid input value!");

}while(weight<=0);

 if(weight<=2)

    charge=wt_2;

else if(weight<=6 && weight>2)

    charge=wt_6;

else if(weight<=10 && weight>6)

    charge=wt_10;

else

    charge=wt_more;

System.out.println("Shipping charges for the entered weight are $"+charge);

}

}

OUTPUT

Enter the weight of the package: 0

Invalid input value!

Enter the weight of the package: 4

Shipping charges for the entered weight are $3.0

Explanation:

1. The variables to hold all the shipping charges are declared as double and initialized.

   static double wt_2=1.50;

   static double wt_6=3;

   static double wt_10=4;

   static double wt_more=4.75;

2. The variable to hold the user input is declared as double.

   static double charge;

   static double weight;

3. The variable to hold the final shipping charge is also declared as double.  

4. Inside main(), an object of Scanner class is created. This is not declared static since declared inside a static method, main().

Scanner sc = new Scanner(System.in);

5. Inside do-while loop, user input is taken until a valid value is entered.

6. Outside the loop, the final shipping charge is computed using multiple if-else statements.

7. The final shipping charge is then displayed to the user.

8. All the code is written inside class since java is a purely object-oriented language.

9. The object of the class is not created since only a single class is involved.

10. The class having the main() method is declared public.  

11. The program is saved with the same name as that of the class having the main() method.

12. The program will be saved as ShippingCharge.java.

13. All the variables are declared as static since they are declared outside main(), at the class level.

A vSphere Administrator is receiving complaints a database VM is experiencing performance issues. The VM is a member of the high priority resource pool and the cluster has not experienced contention.
Which condition should be checked to address immediate performance concerns?
A. VM snapshots
B. VMFS version
C. Resource Pool share value
D. Configured CPU shares

Answers

Answer:

C. Resource Pool share value.

Explanation:

The vSphere is a term used to describe the VMware’s virtualization cloud platform. The vSphere comprises of the following, vCenter Server, ESXi, Virtual Machine File System (VMFS) and vCenter Client.

If a vSphere Administrator receive complaints that a database Virtual Machine (VM) is experiencing performance issues and the Virtual Machine (VM) is a member of the high priority resource pool and the cluster has not experienced contention.

In order to address immediate performance concerns, the vSphere Administrator should check the Resource Pool share value.

VMware resource pool refers to the aggregated central processing unit and memory allocated to a Virtual Machine (VM) for flexible management of the resources.

Also, the vSphere Administrator should install VMware tools to check which processes are having high CPU usage by using vimtop, as well as checking if vCenter Server is swapping.

a. A programmer wrote a software delay loop that counts the variable (unsigned int counter) from 0 up to 40,000 to create a small delay. If the user wishes to double the delay, can they simply increase the upperbound to 80,000?
b. If the code contains a delay loop and we noticed that no delay is being created at run-time. What should we suspect during debugging?

Answers

Answer:

Explanation:

The objective here is to determine if the programmer can simply increase the upperbound to 80,000.

Of course Yes, The programmer can simply increase the delay by doubling the upperbound by 80000. The representation can be illustrated as:

( int : i = 0;  i <  40,000; i ++ )

{

  // delay code

}

Which can be modified as:

( int : i = 0;  i <  80,000; i ++ )

{

  // delay code

}

b)  If the code contains a delay loop and we noticed that no delay is being created at run-time. What should we suspect during debugging?

Assuming there is no delay being created at the run-time,

The code is illustrated as:

For ( int : i = 0 ; i < 0 ; i ++ )

{

  // delay code which wont

  //execute since code delay is zero

}

we ought to check whether the loop is being satisfied or not.  At the Initial value of loop variable, is there any break or exit statement is being executed in between loop. Thus, the  aforementioned delay loop wont be executed since the loop wont be executed for any value of i.

what is computer aided design​

Answers

Computer-aided design (CAD) is the use of computers (or workstations) to aid in the creation, modification, analysis, or optimization of a design.[1] CAD software is used to increase the productivity of the designer, improve the quality of design, improve communications through documentation, and to create a database for manufacturing. hope this helps!!!

You have recently resolved a problem in which a user could not print to a particular shared printer by upgrading her workstation's client software. Which of the following might be an unintended consequence of your solution?

a. The user complains that word-processing files on her hard disk take longer to open.
b. The user is no longer able to log on to the network.
c. The shared printer no longer allows users to print double-sided documents.
d. The shared printer no longer responds to form-feed commands from the print server.

Answers

Answer:

B - The user is no longer able to log on to the network

Explanation:

Write a loop that sets each array element to the sum of itself and the next element, except for the last element which stays the same. Be careful not to index beyond the last element. Ex:
Initial scores: 10, 20, 30, 40
Scores after the loop: 30, 50, 70, 40
The first element is 30 or 10 + 20, the second element is 50 or 20 + 30, and the third element is 70 or 30 + 40. The last element remains the same.
SAMPLE OUTPUT:
#include
int main(void) {
const int SCORES_SIZE = 4;
int bonusScores[SCORES_SIZE];
int i = 0;
bonusScores[0] = 10;
bonusScores[1] = 20;
bonusScores[2] = 30;
bonusScores[3] = 40;
/* Your solution goes here */
for (i = 0; i < SCORES_SIZE; ++i) {
printf("%d ", bonusScores[i]);
}
printf("\n");
return 0;
}

Answers

Answer:

Replace /* Your solution goes here */  with the following lines of code

for(i = 0;i<SCORES_SIZE-1;i++)

{

bonusScores[i]+=bonusScores[i+1];

}

Explanation:

The above iteration starts from the index element (element at 0) and stops at the second to the last element (last - 1).

Using an iterative variable, i

It adds the current element (element at i) with the next element; element at i + 1.

The full code becomes

#include<iostream>

using namespace std;

int main(void) {

const int SCORES_SIZE = 4;

int bonusScores[SCORES_SIZE];

int i = 0;

bonusScores[0] = 10;

bonusScores[1] = 20;

bonusScores[2] = 30;

bonusScores[3] = 40;

for(i = 0;i<SCORES_SIZE-1;i++)

{

bonusScores[i]+=bonusScores[i+1];

}

/* Your solution goes here */

for (i = 0; i < SCORES_SIZE; ++i) {

printf("%d ", bonusScores[i]);

}

printf("\n");

return 0;

}

See attachment for .cpp file

Answer:int main() {

const int SCORES_SIZE = 4;

int bonusScores[SCORES_SIZE];

int i;

for (i = 0; i < SCORES_SIZE; ++i) {

cin >> bonusScores[i];

}

for (i = 0; i < SCORES_SIZE-1; ++i){

bonusScores[i] += bonusScores[i+1];

}

for (i = 0; i < SCORES_SIZE; ++i) {

cout << bonusScores[i] << " ";

}

cout << endl;

return 0;

}

Explanation: SCORES_SIZE -1 will prevent the for loop from going past the last value in the array. bonusScores[i] += will add the value of bonusScores[i+1] to the original bonusScores[i].

for example, i = 1; 1 < SCORES_SIZE - 1 ; bonusScores[1] += bonusScores[1+1} becomes{ bonusScores[1] + bonusScores{2];

Can you please at least give me some part of the code. At least how to start it in C++. Thank you!
Project 5: You will design and implement various classes and write a program to manage one of the following a bank, a hospital, a library, a business, an organization, etc.) The program must do the following:
1. Allow the initialization of the different attributes of the objects from the keyboard.
2. Allow the initialization of the different attributes from a file
3. Perform calculations on one (or more) of the attributes (e.g. calculateInterest, generateHospitalBill, calculateCheckedBooks, etc.)
4. Output a report of all objects created. The report called for by requirement 4 should output all information about each object. You will need to take advantage of the capabilities of C++ classes, inheritance and overriding.
Program Design:
1. Create at least one base class. All data members have to be private. Your main function and any function that it calls should use the member functions of this class for all transactions.
2. Create at least two derived class of the base class described in the previous point.
3. The program will maintain arrays of objects that interacts with each other to manage the designated establishment (bank, hospital, library, etc.). Please do not use anything more sophisticated than an array.
4. Keep the program simple. I am interested in whether you can demonstrate basic competence in the use of classes, inheritance, and good design.
5. All data members in the classes must be private. This is to assure that you use the C++ capabilities that this assignment is all about. Do not use any global variables.
6. When the user decides to quit the updated information is saved back to the secondary storage to give the user the option to either start fresh or continue where he/she left off at the beginning of the next execution

Answers

Answer:

Explanation:

The objective of this question is to  compute a program  that involve using  a  C++ code for  designing and implementing  a Bank Account Management Simulator with integrated file storage for saving details to secondary storage.

When writing this code I notice the words are more than 5000 maximum number of characters the text editor can contain, so i created a word document for it. The attached file  to the word document can be found below.

Write a function called unzip that takes as parameter a sequence (list or tuple) called seq of tuples with two elements. The function must return a tuple where the first element is a list with the first members of the seq tuple and the second element is a list with the second members of the seq tuple.
This example clarifies what is required:
Ist =[(1, "one"), (2, "two"), (3, "three")]
tup= unzip(Lst) lst tup
print(tup)
#prints ([1, 2, 3], ['one', two','three'7)

Answers

Answer:

Here is the function unzip:

def unzip(lst):

   result= zip(*lst)

   return list(result)

The complete program in Python is given below:

def unzip(lst):

   result= zip(*lst)

   return list(result)

   

lst =[(1, "one"), (2, "two"), (3, "three")]

tup= unzip(lst)

print(tup)

Explanation:

Here zip() function is used in the unzip function. The return type of zip() function is a zip object. This means the function returns the iterator of tuples. This function can be used as its own inverse by using the * operator.

If you do not want to use zip() function then the above program can also be implemented as following which uses a for loop for elements in the given list (lst). This can make a pair of lists (2 tuple) instead of list of tuples:

def unzip(lst):

   output = ([ a for a,b in lst ], [ b for a,b in lst ])

   return output

   

lst =[(1, "one"), (2, "two"), (3, "three")]  

tup= unzip(lst)  

print(tup)

The programs along with their output are attached.

Write a Python program that can compare the unit (perlb) cost of sugar sold in packages with different weights and prices. The program prompts the user to enter the weight and price of package 1, then does the same for package 2, and displays the results to indicate sugar in which package has a better price. It is assumed that the weight of all packages is measured in lb. The program should check to be sure that both the inputs of weight and price are both positive values.

Answers

Answer:

This program is written using python

It uses less comments (See explanation section for more explanation)

Also, see attachments for proper view of the source code

Program starts here

#Prompt user for price of package 1

price1 = int(input("Enter Price 1: "))

while(price1 <= 0):

     price1 = int(input("Enter Price 1: "))

#Prompt user for weight of package 1

weight1 = int(input("Enter Weight 1: "))

while(weight1 <= 0):

     weight1 = int(input("Enter Weight 1: "))

#Calculate Unit of Package 1

unit1 = float(price1/weight1)

print("Unit cost of Package 1: "+str(unit1))

#Prompt user for price of package 2

price2 = int(input("Enter Price 2: "))

while(price2 <= 0):

     price2 = int(input("Enter Price 2: "))

#Prompt user for weight of package 2

weight2 = int(input("Enter Weight 2: "))

while(weight2 <= 0):

     weight2 = int(input("Enter Weight 2: "))

#Calculate Unit of Package 2

unit2 = float(price2/weight2)

print("Unit cost of Package 2: "+str(unit2))

#Compare units

if unit1 > unit2:

     print("Package 1 has a better price")

elif unit1 == unit2:

     print("Both Packages have the same price")

else:

     print("Package 2 has a better price")

Explanation:

price1 = int(input("Enter Price 1: ")) -> This line prompts the user for price of package 1

The following while statement is executed until user inputs a value greater than 1 for price

while(price1 <= 0):

     price1 = int(input("Enter Price 1: "))

weight1 = int(input("Enter Weight 1: ")) -> This line prompts the user for weight of package 1

The following while statement is executed until user inputs a value greater than 1 for weight

while(weight1 <= 0):

     weight1 = int(input("Enter Weight 1: "))

unit1 = float(price1/weight1) -> This line calculates the unit cost (per weight) of package 1

print("Unit cost of Package 1: "+str(unit1)) -> The unit cost of package 1 is printed using this print statement

price2 = int(input("Enter Price 2: ")) -> This line prompts the user for price of package 2

The following while statement is executed until user inputs a value greater than 1 for price

while(price2 <= 0):

     price2 = int(input("Enter Price 2: "))

weight2 = int(input("Enter Weight 2: ")) -> This line prompts the user for weight of package 2

The following while statement is executed until user inputs a value greater than 1 for weight

while(weight2 <= 0):

     weight2 = int(input("Enter Weight 2: "))

unit2 = float(price2/weight) -> This line calculates the unit cost (per weight) of package 2

print("Unit cost of Package 2: "+str(unit2)) -> The unit cost of package 2 is printed using this print statement

The following if statements compares and prints which package has a better unit cost

If unit cost of package 1 is greater than that of package 2, then package 1 has a better priceIf unit cost of both packages are equal then they both have the same priceIf unit cost of package 2 is greater than that of package 1, then package 2 has a better price

if unit1 > unit2:

     print("Package 1 has a better price")

elif unit1 == unit2:

     print("Both Packages have the same price")

else:

     print("Package 2 has a better price")

web pages with personal or biograpic information are called ​

Answers

Answer:

Web pages with personal or biographic information are called. a. Social Networking sites. c.

Explanation:

What’s the best way to figure out what wires what and goes where?

Answers

Try to untangle them, First!
Then the color of the wire must match the color hole it goes in (I’m guessing)
I’m not good with electronics so sorry.

Consider that a large online company that provides a widely used search engine, social network, and/or news service is considering banning ads for the following products and services from its site: e-cigarettes, abortion clinics, ice cream, and sugared soft drinks. Which, if any, do you think they should ban? Give reasons. In particular, if you select some but not all, explain the criteria for distinguishing.

Answers

Answer:

I think that they should ban ads for all four products.  These products, e-cigarettes, abortion clinics, ice cream, and sugared soft drinks, are all discreet adult products that should not be advertised because of their health hazards.  Since the "large online company provides a widely used search engine, social network, and/or news service, which are mainly patronized by younger people, such ads that promote products injurious to individual health should be banned.  Those who really need or want these products know where they could get them.  Therefore, the products should not be made easily accessible to all people.  Nor, should ads promote their patronage among the general population.

Explanation:

Advertisements create lasting and powerful images which glamourize some products, thereby causing the general population, especially children, to want to consume them without any discrimination of their health implications.  If online banning is then contemplated, there should not be any distinguishing among the four products: e-cigarettes, abortion clinics, ice cream, and sugared soft drinks.

Write a Java program that reads from the user four grades between 0 and 100. The program the, on separate ines, prints out the entered grades followed by the highest grade, lowest grade, and averages of all four grades. Make sure to properly label your output. Use escape characters to line up the outputs after the labels.

Answers

Answer:

import java.util.*;

public class Grade {

   

   public static void main(String[] args) {

     

       Scanner input = new Scanner(System.in);

       double[] grades =  new double[4];

       

       for (int i=0; i<4; i++){

           System.out.print("Enter a grade: ");

           grades[i] = input.nextDouble();

       }

       

       double lowest = grades[0];

       double highest = grades[0];

       double total = 0;

       

       for (int i=0; i<4; i++){

           System.out.println("Grade " + (i+1) + " is: "  + grades[i]);

           

           if(grades[i] >= highest)

               highest = grades[i];

           if(grades[i] <= lowest)

               lowest = grades[i];

           

           total += grades[i];

           

       }

       double average = total/4;

       

       System.out.println("The highest grade is: " + highest);

       System.out.println("The lowest grade is: " + lowest);

       System.out.println("The average is: " + average);

  }

}

Explanation:

Ask the user for the grades and put them in the grades array using a for loop

Create another for loop. Inside the loop, print the grades. Find highest and lowest grades in the grades array using if-structure. Also, add each grade to the total.

When the loop is done, calculate the average, divide the total by 4.

Print the highest grade, lowest grade and average.

Write a program that asks the user to enter either an "African" or a "European" swallow. The programâs behaviour should mimic the program below. If the user enters something øther than "African" or "European", the program shøuld insult the user like the example below.

Sample Output #1:

What kind of swallow?
African
Yes, it could grip it by the husk.

Sample Output #2:

What kind of swallow?
European
A five-ounce bird could not carry a one-pound coconut.

Sample Output #3:

What kind of swallow?
Spanish
You really are not fit to be a king.

Answers

Answer:

The programming language is not stater; However, I'll answer this question using C++.

This program does not use comments (See explanation)

See Attachment for program file

Program starts here

#include <iostream>

using namespace std;

int main()

{

string response;

cout<<"What kind of swallow?\n";

cin>>response;

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

{

 response[i]=toupper(response[i]);

}

   if(response == "AFRICAN")

   {

    cout<<"Yes, it could grip it by the husk.";

}

else if(response == "EUROPEAN")

   {

    cout<<"A five-ounce bird could not carry a one-pound coconut.";

}

else

{

 cout<<"You really are not fit to be a king.";

}

   return 0;

}

Explanation:

string response; -> A string variable to hold user input is declared

cout<<"What kind of swallow?\n"; -> prompts user for input

cin>>response; -> user input is stored here

The following iteration converts user input to uppercase; so that the program will work for inputs like African, AFRICAN, AFriCAN, etc.

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

{

 response[i]=toupper(response[i]);

}

The following if statement prints "Yes, it could grip it by the husk." if user input is AFRICAN

   if(response == "AFRICAN")

   {

    cout<<"Yes, it could grip it by the husk.";

}

Otherwise, if user input is EUROPEAN, it prints; "A five-ounce bird could not carry a one-pound coconut."

else if(response == "EUROPEAN")

   {

    cout<<"A five-ounce bird could not carry a one-pound coconut.";

}

Lastly; for every inputs different from AFRICAN and EUROPEAN, the program displays "You really are not fit to be a king."

else

{

 cout<<"You really are not fit to be a king.";

}

Type a statement using srand() to seed random number generation using variable seedVal. Then type two statements using rand() to print two random integers between (and including) 0 and 9. End with a newline. Ex: 5 7 Note: For this activity, using one statement may yield different output (due to the compiler calling rand() in a different order). Use two statements for this activity. Also, after calling srand() once, do not call srand() again. (Notes)
GIVEN:
#include
#include // Enables use of rand()
#include // Enables use of time()
int main(void) {
int seedVal = 0;
/* Your solution goes here */
return 0;
}
2). Type two statements that use rand() to print 2 random integers between (and including) 100 and 149. End with a newline. Ex:
101
133
Note: For this activity, using one statement may yield different output (due to the compiler calling rand() in a different order). Use two statements for this activity. Also, srand() has already been called; do not call srand() again.
GIVEN:
#include
#include // Enables use of rand()
#include // Enables use of time()
int main(void) {
int seedVal = 0;
seedVal = 4;
srand(seedVal);
/* Your solution goes here */
return 0;
}

Answers

Answer:

1. The solution to question 1 is as follows;

srand(seedVal);

cout<<rand()%10<<endl;

cout<<rand()%10<<endl;

2. The solution to question 2 is as follows

cout<<100+rand()%50 <<endl;

cout<<100+rand()%50 <<endl;

Explanation:

The general syntax to generate random number between interval is

Random Number = Lower Limit + rand() % (Upper Limit - Lower Limit + 1)

In 1;

The solution starts by calling srand(seedVal);

The next two statements is explained as follows

To print two random integers between intervals of 0 and 9 using rand()"

Here, the lower limit = 0

the upper limit =  9

By substituting these values in the formula above; the random number will be generated as thus;

Random Number = 0 + rand() % (9 - 0 + 1)

Random Number = 0 + rand() % (10)

Random Number = rand() % (10)

So, the instruction to generate the two random variables is rand() % (10)

2.

Similar to 1 above

To print two random integers between intervals of 100 and 149 using rand()"

Here, the lower limit = 100

upper limit = 149

By substituting these values in the formula above; the random number will be generated as thus;

Random Number = 100 + rand() % (149 - 100 + 1)

Random Number = 100 + rand() % (50)

So, the instruction to generate the two random variables is 100 + rand() % (50)

During an investigation of a cybercrime, the law enforcement officers came across a computer that had the hard drive encrypted. Chose the best course of action they should take to access the data on that drive.
a. Use image filtering techniques to see what's behing the encrypted files.
b. Try to convince the owner of the computer to give you to decryption key/password.
c. Identify the encryption algorithm and attempt a brute force attack to get access to the file.
d. Disconnect the hard drive from power so the encryption key can be exposed on the next power up.
e. Try to copy the drive bit by bit so you can see the files in each directory.

Answers

Answer:

b. Try to convince the owner of the computer to give you to decryption key/password.

Explanation:

Encrypted hard drives have maximum security and high data protection. to access them you need to enter a password to unlock them.

The image filtering technique is a method that serves to selectively highlight information contained in an image, for which it does not work.

The encryption algorithm is a component used for the security of electronic data transport, not to access data on an encrypted hard drive.

The encryption key is used in encryption algorithms to transform a message and cannot be exposed by disconnecting the hard drive from its power source.

Consider a recurrent neural network that listens to a audio speech sample, and classifies it according to whose voice it is. What network architecture is the best fit for this problem

Answers

Answer:

Many-to-one (multiple inputs, single output)

Explanation:

Solution

In the case of a recurrent neural network that listens to a audio speech sample, and classifies it according to whose voice it is, the RNN will listen to the audio and will give result by doing classification.

There will be a single output, for the classified or say identified person.

The RNN will take a stream of input as the input is a audio speech sample.

Therefore, there will be multiple inputs to the RNN and a single output, making the best fit Architecture to be of type Many-to-one(multiple inputs, single output).

Given main(), define the Team class (in file Team.java). For class method getWinPercentage(), the formula is:teamWins / (teamWins + teamLosses)Note: Use casting to prevent integer division.Ex: If the input is:Ravens133 where Ravens is the team's name, 13 is number of team wins, and 3 is the number of team losses, the output is:Congratulations, Team Ravens has a winning average!If the input is Angels 80 82, the output is:Team Angels has a losing average.Here is class WinningTeam:import java.util.Scanner;public class WinningTeam {public static void main(String[] args) {Scanner scnr = new Scanner(System.in);Team team = new Team();String name = scnr.next();int wins = scnr.nextInt();int losses = scnr.nextInt();team.setTeamName(name);team.setTeamWins(wins);team.setTeamLosses(losses);if (team.getWinPercentage() >= 0.5) {System.out.println("Congratulations, Team " + team.getTeamName() +" has a winning average!");}else {System.out.println("Team " + team.getTeamName() +" has a losing average.");}}}

Answers

Answer:

Explanation:

public class Team {

   private String teamName;

   private int teamWins;

   private int teamLosses;

   public String getTeamName() {

       return teamName;

   }

   public void setTeamName(String teamName) {

       this.teamName = teamName;

   }

   public int getTeamWins() {

       return teamWins;

   }

   public void setTeamWins(int teamWins) {

       this.teamWins = teamWins;

   }

   public int getTeamLosses() {

       return teamLosses;

   }

   public void setTeamLosses(int teamLosses) {

       this.teamLosses = teamLosses;

   }

   public double getWinPercentage() {

       return teamWins / (double) (teamWins + teamLosses);

   }

}

Following are the Java program to define the Team class and calculate its  value:

Class Definition:

class Team //defining the class Team

{

   private String teamName;//defining String variable

   private int teamWins, teamLosses;//defining integer variable

   //defining the set method to set value the input value

   public void setTeamName(String teamName)//defining setTeamName method that takes one String parameter

   {

       this.teamName = teamName;//using this keyword that sets value in teamName

   }

   public void setTeamWins(int teamWins) //defining setTeamWins method that takes one integer parameter

   {

       this.teamWins = teamWins;//using this keyword that sets value in teamWins

   }

   public void setTeamLosses(int teamLosses)//defining setTeamLosses method that takes one integer parameter

   {

       this.teamLosses = teamLosses;//using this keyword that sets value in teamLosses

   }

   //defining the get method that returns the input value

   public String getTeamName() //defining getTeamName method

   {

       return teamName;//return teamName value

   }

   public int getTeamWins()  //defining getTeamWins method

   {

       return teamWins;//return teamWins value

   }

   public int getTeamLosses() //defining getTeamLosses method

   {

       return teamLosses;//return teamLosses value

   }

   public double getWinPercentage()//defining getWinPercentage method

   {              

       return ((teamWins * 1.0) / (teamWins + teamLosses));//using the return keyword that returns percentage value

   }      

}

Please find the complete code in the attached file and its output file in the attached file.

Class definition:

Defining the class "Team".Inside the class two integer variable "teamWins, teamLosses" and one string variable "teamName" is declared.In the next step, the get and set method is defined, in which the set method is used to set the value, and the get method is used to return the value.

Find out more about the Class here:

brainly.com/question/17001900

Larry sees someone he finds annoying walking toward him. Larry purposely looks away and tries to engage in conversation with someone else. Which type of eye behavior is Larry using?
a. mutual lookingb. one-sided lookingc. gaze aversiond. civil inattentione. staring

Answers

Answer:

one-sided looking

Explanation:

Larry purposely looks away

What did Aristotle teach?

Answers

Philosophy, I beleive. He tought Sikander liturature and eloquence, but his most famous teachings were of philosophy.

Aristotle taught the world science. He was considered the best scientists of his time.

An introduction to object-oriented programming.
Write a GUI program named EggsInteractiveGUI that allows a user to input the number of eggs produced in a month by each of five chickens. Sum the eggs, then display the total in dozens and eggs. For example, a total of 127 eggs is 10 dozen and 7 eggs.

Answers

Answer:

The csharp program is given below.

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

namespace WindowsFormsApplication1

{

   public partial class Form1 : Form

   {

       public Form1()

       {

           InitializeComponent();

      }

       private void button6_Click(object sender, EventArgs e)

       {

           int total = (Convert.ToInt32(textBox1.Text) +  Convert.ToInt32(textBox2.Text) + Convert.ToInt32(textBox3.Text) + Convert.ToInt32(textBox4.Text) + Convert.ToInt32(textBox5.Text));

           int dozen = total / 12;

           int eggs = total % 12;

           textBox6.Text = dozen.ToString();

           textBox7.Text = eggs.ToString();

       }

       private void button7_Click(object sender, EventArgs e)

       {

           textBox1.Text = "";

           textBox2.Text = "";

           textBox3.Text = "";

           textBox4.Text = "";

           textBox5.Text = "";

           textBox6.Text = "";

           textBox7.Text = "";

       }

        private void button8_Click(object sender, EventArgs e)

       {

           Close();

       }

    }

}

Explanation:

1. The integer variables are declared for total eggs, number of dozens and number of eggs.

2. The input of each text box is converted into integer by using the Convert.ToInt32() method on the value of that particular text box.

3. All the inputs are added and the sum is assigned to variable, total.

4. The number of dozens are obtained by dividing total by 12 and assigning the value to the variable, dozen.

5. The number of extra eggs are obtained by taking the modulus of total and 12 and the value is assigned to the variable, eggs.

6. The integer values in the variables, dozen and eggs, are converted into string using the ToString() function with that particular value.

dozen.ToString();

eggs.ToString();

7. The text boxes are assigned the respective values of dozens and number of eggs.

textBox6.Text = dozen.ToString();

textBox7.Text = eggs.ToString();

8. Two additional buttons, clear and exit, are also added.

9. The clear button erases the contents of all the text boxes. The Text property of each textbox is set to “” thereby clearing all the text fields.

10. The exit button closes the application using Close() function.

11. The program is made in visual studio and the output is attached.

If you were required to give a speech identifying the risks of using computers and digital devices, which group of items would you include?

Answers

Camera and Mic

These 2 things are the most likely things to get you in trouble. Unless you have a 100% protected device, and honestly even if you do, cover up the camera and close your mic. This will definitely save you later.

It's inventiveness, uncertainty futuristic ideas typically deal with science and technology.what is it?

Answers

Answer:

Engineering and Science

Explanation:

Other Questions
NEED HELP ASAPWhich of the following statements is true? A) All people who are deaf want their hearing fixed. B) Special devices alert deaf drivers to emergency vehicles. C) Deaf people are unable to drive. D) American Sign Language is a visual form of English.I think it might be B or D Which would have more humus a desert or a forest Format and punctuate the address correctly by fixing the one error. Lisa Harper 11 Pratt Cir. Port Royal KY 40058 Who can solve for Y ? 2y < -4 WILL GIVE BRAINIEST!!Scientists use models of earthquakes to (5 points)change their locationstop them from occurringunderstand the processincrease the waves formed in the process The management of company B believes that money is the only way to motivate employees. Do u agree.justify ur answer?pls Some times ethos pathos logos can be used to make people believe things that are not entirely true give an example how can people avoid being tricked by fault persuasion tactics The radius of a circle is 5 feet. What is the circumference?Give the exact answer in simplest form.feet If (5, 4) and (7, 2) are the endpoints of a diameter of a circle, what is the equation of the circle? A)(x 6)2 + (y + 3)2 = 2 B)(x 6)2 + (y 3)2 = 2 C)(x + 6)2 + (y +3)2 = 8 D)(x + 6)2 + (y 3)2 = 8 Allan built a doghouse and he wanted the house to have an area of 24 square feet. He also wanted the width to be 2/3 the length. What are the dimensions of the doghouse? What is the equation of the translated function, g(x), iff(x) = x?? which two of the following is continuous data? In which area of the world did agriculture begin to develop between 9000 BCEand 1000 BCE? A. Modern-day Western United States and CanadaB. Modern-day Eastern BrazilC. Modern-day Sub-Saharan AfricaD. Modern-day Australia A way that landowners took advantage of sharecroppers was by:A. allowing only whites to farm the land.B. allowing only African Americans to farm the land.O c. taking their seeds and tools.D. paying less for crops raised by African Americans.SUBMIT A cola manufacturer invited consumers to take a blind taste test. Consumers were asked to decide which of two sodas they preferred. The manufacturer was also interested in what factors played a role in taste preferences. Suppose the manufacturer wanted to test to determine if the males preferred its brand more than the females. Using the test statistic given in the printout, compute the appropriate p-value for the test. A. 0.0340 B. 0.0171 C. 04681 D. 0.2119 if one song is $50 and i have $17000 how many songs can i buy Please help! Correct answer only!For a fundraiser, there is a raffle with 100 tickets. One ticket will win a $150 prize, and the rest will win nothing. If you have a ticket, what is the expected payoff?$ ___ please!!1!1!the triple of the area of a square is 1587 m2 What is the side of the square? What is solid carbon dioxide oxide What do all organisms have ?