Complete the function to replace any period by an exclamation point. Ex: "Hello. I'm Miley. Nice to meet you." becomes:


"Hello! I'm Miley! Nice to meet you!"

#include

#include

using namespace std;

void MakeSentenceExcited(char* sentenceText) {


/* Your solution goes here */

}


int main() {

const int TEST_STR_SIZE = 50;

char testStr[TEST_STR_SIZE];

strcpy(testStr, "Hello. I'm Miley. Nice to meet you.");

MakeSentenceExcited(testStr);


cout << testStr << endl;


return 0;


}

Answers

Answer 1

Answer:

Here is the complete function:

void MakeSentenceExcited(char* sentenceText) {  // function that takes the text as parameter and replaces any period by an exclamation point in that text

int size = strlen(sentenceText);  //returns the length of sentenceText string and assigns it to size variable

char * ptr;  // character type pointer ptr

ptr = sentenceText;  // ptr points to the sentenceText string

for (int i=0; i<size; i++){  //iterates through the sentenceText string using i as an index

    if (sentenceText[i]=='.'){  // if the character at i-th index of sentenceText is a period

        sentenceText[i]='!'; } } } //places exclamation mark when it finds a period at i-th index of sentenceText

Explanation:

The program works as follows:

Suppose we have the string:

sentenceText = "Hello. I'm Miley. Nice to meet you."

The MakeSentenceExcited method takes this sentenceText as parameter

int size = strlen(sentenceText) this returns the length of sentenceText

The size of sentenceText is 35 as this string contains 35 characters

size =  35

Then a pointer ptr is declared which is set to point to sentenceText

for (int i=0; i<size; i++) loop works as follows:    

1st iteration:

i=0

i<size is true because i=0 and size = 35 so 0<35

So the body of loop executes:

 if (sentenceText[i]=='.') statement checks :

if (sentenceText[0]=='.')

The first element of sentenceText is H

H is not a period sign so the statement inside if statement does not execute and value of i increments to 1. Now i = 1

2nd iteration:

i=1

i<size is true because i=1 and size = 35 so 1<35

So the body of loop executes:

 if (sentenceText[i]=='.') statement checks :

if (sentenceText[1]=='.')

This is the second element of sentenceText i.e. e

e is not a period sign so the statement inside if statement does not execute and value of i increments to 1. Now i = 2

So at each iteration the if condition checks if the character at i-th index of string sentenceText is a period.

Now lets see a case where the element at i-th index is a period:

6th iteration:

i=5

i<size is true because i=5 and size = 35 so 5<35

So the body of loop executes:

 if (sentenceText[i]=='.') statement checks :

if (sentenceText[5]=='.')

This is the character at 5th index of sentenceText i.e. "."

So the if condition evaluates to true and the statement inside if part executes:

sentenceText[i]='!'; statement becomes:

sentenceText[5]='!'; this means that the character at 5th position of sentenceText string is assigned an exclamation mark.

So from above 6 iterations the result is:

Hello!

This loop continues to execute until all the characters of sentenceText are checked and when the value of i gets greater than or equal to the length of sentenceText then the loop breaks.

The screenshot of the program along with its output is attached.

Complete The Function To Replace Any Period By An Exclamation Point. Ex: "Hello. I'm Miley. Nice To Meet

Related Questions

mplement the function fileSum. fileSum is passed in a name of a file. This function should open the file, sum all of the integers within this file, close the file, and then return the sum.If the file does not exist, this function should output an error message and then call the exit function to exit the program with an error value of 1.Please Use This Code Template To Answer the Question#include #include #include //needed for exit functionusing namespace std;// Place fileSum prototype (declaration) hereint main() {string filename;cout << "Enter the name of the input file: ";cin >> filename;cout << "Sum: " << fileSum(filename) << endl;return 0;}// Place fileSum implementation here

Answers

Answer:

Which sentence best matches the context of the word reticent as it is used in the following example?

We could talk about anything for hours. However, the moment I brought up dating, he was extremely reticent about his personal life.

Explanation:

Which sentence best matches the context of the word reticent as it is used in the following example?

We could talk about anything for hours. However, the moment I brought up dating, he was extremely reticent about his personal life.

1011111 ÷ 11 in numerical​

Answers

Answer:

91919.18182

Explanation:

Answer:

91,919 .1

HOPE IT HELPS .

Complete the function by filling in the missing parts. The color_translator function receives the name of a color, then prints its hexadecimal value. Currently, it only supports the three additive primary colors (red, green, blue), so it returns "unknown" for all other colors. m 1 - def color_translator(color): 2. if _== "red": 3 hex_color = "#ff0000" 4- elif == "green": 5 hex_color = "#00ff00" elif == "blue": hex_color = "#0000ff" in 0 hex_color = "unknown" return _ . 12 13 14 15 16 17 print(color_translator("blue")) # Should be #0000ff print(color_translator ("yellow")) # should be unknown print(color_translator("red")) # Should be #ff0000 print(color_translator ("black")) # should be unknown print(color_translator("green")) # Should be #00ff00 print(color translator("")) # should be unknown Run Reset

Answers

Answer:

The completed program is

def color_translator(color):

      if color == "red":

             hex_color = "#ff0000"

      elif color == "green":

             hex_color = "#00ff00"

      elif color == "blue":

             hex_color = "#0000ff"

      else:

             hex_color = "unknown"

      return hex_color

Explanation:

Since the parameter in the above function is color,

This variable will serve as the name of a color and it'll be used in the conditional statements to check if the name of color is any of red, green and blue;

And that is why we have

if color == "red":

elif color == "green":

elif color == "blue":

The variable used to hold the color codes, hex_color, will be returned at the end of the function and that's why we have

return hex_color

When the program is tested with print(color_translator("blue")) and others, it prints the desired output

What command would you use to place the cursor in row 10 and column 15 on the screen or in a terminal window

Answers

Answer:

tput cup 10 15

Explanation:

tput is a command for command line environments in Linux distributions. tput can be used to manipulate color, text color, move the cursor and generally make the command line environment alot more readable and appealing to humans. The tput cup 10 15 is used to move the cursor 10 rows down and 15 characters right in the terminal

By using ____, you can use reasonable, easy-to-remember names for methods and concentrate on their purpose rather than on memorizing different method names.

Answers

Answer:

Polymorphism

Explanation:

If we use polymorphism so we can apply the names that could be easy to remember for the methods' purpose.

The information regarding the polymorphism is as follows:

The person has various attributes at the same timeFor example,  a man could be a father, a husband, an entrepreneur at the same time.In this, the similar person has different types of behavior in different situations.

Therefore we can conclude that If we use polymorphism so we can apply the names that could be easy to remember for the methods' purpose.

Learn more about the behavior here: brainly.com/question/9152289

viết chương trình hoàn chỉnh các yêu cầu sau:
a. Định nghĩa hàm có tên là PSTG(), có hai tham số kiểu nguyên x và y hàm trả về giá trị phân số x/y ở dạng tối giản.
b. Gọi hàm đã định nghĩa ở trên trong hàm main () để in lên mà hình một phân số x/y ở dạng tối giản, với x và y được nhập từ bàn phím.

Answers

Explanation:

the perimeter of an aluminium sheet is 120 CM if its length is reduced by 10% and its breadth is increased by 20% the perimeter does not change find the measure of the length and the breadth of the sheet

Does clicking ads and pop ups like the one shown in this image could expose your computer to malware?

Answers

Answer: Yes, clicking adds/popups like the one in the image could cause your computer/electronic to catch viruses/malware.

Explanation: The cause to this is when you click an ad/popup you're exposing yourself to a potential dangerous/visious site. You're unaware to where the popup could bring you, and for all we know it could bring us to a fake site for a download which is really a visious malware to be downloaded to your device.

which approach does procedural programming follow? bottom up, top down, random, or object oriented​

Answers

Answer:

Top to down approach

Explanation:

Explain how/where could you change the NIC Card configuration from dynamic DHCP setting to an IP address of 10.254.1.42 with a subnet mask of 255.255.0.0 and a gateway of 10.254.0.1. (hint: we spoke about 2 different methods)

Answers

Answer:

Using the terminal in linux OS to configure a static ip address, gateway and subnet mask.

Explanation:

-Enter the terminal in the linux environment and use the ifconfig eth0 or -a to bring up the main network interface and other network interfaces.

- for static network configuration, use;

  - ifconfig eth0 10.254.1.42  

  - ifconfig eth0 netmask 255.255.0.0

  - ifconfig eth0 broadcast 10.254.255.255

- and add a default gateway with;

 -  route add default gw 10.254.0.1  eth0.

- Now verify the settings with the ifconfig eth0 command.

Tại một xí nghiệp có ba máy làm việc độc lập. Trong một ca, xác suất cần sửa
chữa của từng máy lần lượt là 0,1; 0,15; 0,2. Tính xác suất để trong một ca:
a) Không có máy nào cần sửa chữa.
b) Có nhiều nhất hai máy cần sửa chữa.

Answers

bạn tìm ra cách giải chưa chỉ mình với

thanks b

The Cartesian product of two lists of numbers A and B is defined to be the set of all points (a,b) where a belongs in A and b belongs in B. It is usually denoted as A x B, and is called the Cartesian product since it originated in Descartes' formulation of analytic geometry.

a. True
b. False

Answers

The properties and origin of the Cartesian product as stated in the paragraph

is true, and the correct option is option;

a. True

The reason why the above option is correct is stated as follows;

In set theory, the Cartesian product of two number sets such as set A and set

B which can be denoted as lists of numbers is represented as A×B and is the

set of all ordered pair or points (a, b), with a being located in A and b located

in the set B, which can be expressed as follows;

[tex]\left[\begin{array}{c}A&x&y\\z\end{array}\right] \left[\begin{array}{ccc}B(1&2&3)\\\mathbf{(x, 1)&\mathbf{(x, 2)}&\mathbf{(x, 3)}\\\mathbf{(y, 1)}&\mathbf{(y, 2)}&\mathbf{(y, 3)}\\\mathbf{(z, 1)}&\mathbf{(z, 2)}&\mathbf{(z, 3)}\end{array}\right]}[/tex]

The name Cartesian product is derived from the name of the philosopher,

scientist and mathematician Rene Descartes due to the concept being

originated from his analytical geometry formulations

Therefore, the statement is true

Learn more about cartesian product here:

https://brainly.com/question/13266753

what privacy risks do new technologies present,
and how do we decide if they're worth it?

Answers

Answer:

Los riesgos de las nuevas tecnologías se multiplican a medida que nos hacemos dependientes de ellas. También lo hacen a medida que sustituyen a otras formas de contacto social más cercanas

Los riesgos de las nuevas tecnologías son grandes desconocidos. El mal uso de las redes sociales y de Internet en los ordenadores y en el teléfono móvil, entre otros factores, supone un peligro real para todos los estratos de población, pero en especial para los más jóvenes. Pensemos, ¿realmente somos conscientes de los riesgos que suponen las nuevas tecnologías? ¿Sabemos cómo utilizarlas para no ponernos en riesgo?

Cabe destacar que las denominadas nuevas tecnologías de la información y de la comunicación (TICs) son un distintivo de la época actual y se han convertido en herramientas esenciales en las diferentes áreas de la vida. Esto es, para el área académica, laboral, social, de ocio…

En la mayoría de los ámbitos están presentes las TICS, pues incluyen las diferentes herramientas con las que nos manejamos hoy en día: servicios de contacto electrónico (e-mails, servicios de mensajería instantánea, chats), los teléfonos móviles, tablets y ordenadores, las plataformas online de difusión de contenidos, las redes sociales, entre otros..

Explanation:

Raj was concentrating so much while working on his project plan that he was late for a meeting. When he went back to his office, he noticed his system was restarted and his project file was not updated. What advice would you provide Raj in this situation?

Answers

Answer:

Explanation:

Depending on the software that Raj was using to create his project he should first see if the software itself saved the project. Usually many software such as those included in the Microsoft Office Suite save the file automatically every 5 minutes or so in case of a power outage or abrupt closure of the file. If this is not the case he should try and do a system restore with the unlikely hope that it restores an older version of his project.

In a situation like this, it would be advisable for Raj to contact IT personnels and seek if the files could be retrieved.

Raj being late for a meeting due to what he was doing meant that the project he was working on is very important.

Therefore, to avoid losing thses files, he could contact the IT personnels and request if there is a way to retrieve the project file.

These way, the files could be retrieved and avoid losing his work.

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

________type of website is an interactive website kept constantly updated and relevant to the needs of its customers using a database.

Answers

Answer:

Data-driven Website

Explanation:

A Data-driven website is a type of website that is continually updated by its administrators so as to meet users' needs. It is opposed to a static website whose information remains the same and is never changed once uploaded.

The data-driven website is used in a platform where information has to be continually updated. An example is an online platform where people place orders for goods and services. There are usually changing prices and new goods continually uploaded. So, to keep the consumers updated, the administrators of such platforms would use a data-driven platform.

The speed of a computer is measured in____?​

Answers

Answer:

gigahertz

Explanation:

The clock speed measures the number of cycles your CPU executes per second, measured in GHz (gigahertz)

[tex]\sf{}[/tex]

ANSWER => gigahitrz

Explanation:

The speed of a computer is measured in gigahitrz

Design a class named Rectangle to represent a rectangle. The class contains:

Two double data fields named width and height that specify the width and height of the rectangle. The default values are 1 for both width and height.
A no-arg constructor that creates a default rectangle.
A constructor that creates a rectangle with the specified width and height.
A method named getArea() that returns the area of this rectangle.
A method named getPerimeter() that returns the perimeter.

Draw the UML diagram for the class then implement the class. Write a test program that create two Rectangle objects - one with width 4 and height 40, and the other with width 3.5 and height 35.9.
Display the width, heigth, area, and perimeter of each rectangle in this order.

Answers

Answer:

function Rectangle(width=1, height= 1 ) {

    this.width= width;

    this.height= height;

    this.getArea= ( ) = > {return width * height};

    this.getPerimeter= ( ) = >{ return 2( height + width)};

}

var rectangleOne= new Rectangle(4, 40)

var rectangleTwo= new Rectangle(3.5, 35.9)

console.log(rectangleOne.width, rectangleOne.height, rectangleOne.getArea( ), rectangleOne.getPerimeter( ) )

console.log(rectangleTwo.width, rectangleTwo.height, rectangleTwo.getArea( ), rectangleTwo.getPerimeter( ) )

Explanation:

This is a Javascript class definition with a constructor specifying arguments with default values of one for both width and height, and the getArea and getPerimeter methods.

Write a script named dif.py. This script should prompt the user for the names of two text files and compare the contents of the two files to see if they are the same. If they are, the script should simply output "Yes". If they are not, the script should output "No", followed by the first lines of each file that differ from each other. The input loop should read and compare lines from each file, including whitespace and punctuation. The loop should break as soon as a pair of different lines is found.

Answers

Answer:

Following are the code to this question:

f1=input('Input first file name: ')#defining f1 variable that input file 1

f2=input('Input second file name: ')#defining f2 variable that input file 2

file1=open(f1,'r')#defining file1 variable that opens first files by using open method  

file2=open(f2,'r')#defining file1 variable that opens second files by using open method  

d1=file1.readlines()#defining d1 variable that use readlines method to read first file data

d2=file2.readlines()#defining d2 variable that use readlines method to read second file data

if d1==d2:#defining if block that check file data

   print('Yes')#when value is matched it will print message yes  

   exit# use exit keyword for exit from if block

for j in range(0,min(len(d1),len(d2))):#defining for loop that stores the length of the file  

   if (d1[j]!=d2[j]):#defining if block that check value is not matched

       print('No')#print the message "NO"

       print("mismatch values: ",d1[j]," ",d2[j])#print file values

Output:

please find the attached file.

Explanation:

code description:

In the above code, the "f1 and f2" variable is used for input value from the user end, in which it stores the file names. In the next step, the "file1 and file2" variable is declared that uses the open method to open the file. In the next line, the"d1 and d2" variable is declared for reads file by using the "readlines" method. Then, if block is used that uses the "d1 and d2" variable to match the file value if it matches it will print "yes", otherwise a for loop is declared, that prints files mismatch values.

Answer:

first = input("enter first file name: ")

second = input("enter second file name: ")

file_one = open(first, 'r')

file_two = open(second, 'r')

if file_one.read() == file_two.read():

  print("Both files are the same")

else:

  print("Different files")

file_one.close()

file_two.close()

Consider two different implementations of the same instruction set architecture (ISA). The instructions can be divided into four classes according to their CPI (class A, B, C, and D). P1 with a clock rate of 2.5 GHz have CPIs of 1, 2, 3, and 3 for each class, respectively. P2 with a clock rate of 3 GHz and CPIs of 2, 2, 2, and 2 for each class, respectively. Given a program with a dynamic instruction count of 1,000,000 instructions divided into classes as follows: 10% class A, 20% class B, 50% class C, and 20% class D.which implementation is faster?
a. What is the global CPI for each implementation?
b. Find the clock cycles required in both cases.

Answers

Answer: Find answers in the attachments

Explanation:

Consider the following Stack operations:

push(d), push(h), pop(), push(f), push(s), pop(), pop(), push(m).

Assume the stack is initially empty, what is the sequence of popped values, and what is the final state of the stack? (Identify which end is the top of the stack.)

Answers

Answer:

Sequence of popped values: h,s,f.

State of stack (from top to bottom): m, d

Explanation:

Assuming that stack is  initially empty. Suppose that p contains the popped values. The state of the stack is where the top and bottom are pointing to in the stack. The top of the stack is that end of the stack where the new value is entered and existing values is removed. The sequence works as following:

push(d) -> enters d to the Stack

Stack:  

d ->top

push(h) -> enters h to the Stack

Stack:

h ->top

d ->bottom

pop() -> removes h from the Stack:

Stack:

d ->top

p: Suppose p contains popped values so first popped value entered to p is h

p = h

push(f) -> enters f to the Stack

Stack:

f ->top

d ->bottom

push(s) -> enters s to the Stack

Stack:

s ->top

f

d ->bottom

pop() -> removes s from the Stack:

Stack:

f ->top

d -> bottom

p = h, s

pop() -> removes f from the Stack:

Stack:

d ->top

p = h, s, f

push(m) -> enters m to the Stack:

Stack:

m ->top

d ->bottom

So looking at p the sequence of popped values is:

h, s, f

the final state of the stack:

m, d

end that is the top of the stack:

m

Create a class named CarRental that contains fields that hold a renter's name, zip code, size of the car rented, daily rental fee, length of rental in days, and total rental fee. The class contains a constructor that requires all the rental data except the daily rate and total fee, which are calculated bades on the sice of the car; economy at $29.99 per day, midsize at 38.99$ per day, or full size at 43.50 per day. The class also includes a display() method that displays all the rental data. Create a subclass named LuxuryCarRental. This class sets the rental fee at $79.99 per day and prompts the user to respond to the option of including a chauffer at $200 more per day. Override the parent class display() method to include chauffer fee information. Write an application named UseCarRental that prompts the user for the data needed for a rental and creates an object of the correct type. Display the total rental fee. Save the files as CarRental.java, LuxaryCarRental.java, and UseCarRental.java.

Here is my code:

package CarRental;
public class CarRental
{
String name;
int zipcode;
String size;
double dFee;
int days;
double total;

public String getName()
{
return name;
}
public int getZipcode()
{
return zipcode;
}
public String getSize()
{
return size;
}
public int getDays()
{
return days;
}
public CarRental(String size)
{
if(size.charAt(0)=='m')
dFee = 38.99;
else
if(size.charAt(0)=='f')
dFee = 43.50;
else
dFee = 29.99;
}
public void calculateTotal(int days)
{
total = dFee*days;
}
public void print()
{
System.out.println("Your rental total cost is: $" + total);
}

}

package CarRental;
import java.util.*;
public class LuxaryCarRental extends CarRental
{
public LuxaryCarRental(String size, int days)
{
super(size);
}
public void CalculateTotalN()
{
super.calculateTotal(days);
dFee = 79.99;

int chauffer;
Scanner keyboard = new Scanner(System.in);
System.out.println("Do you want to add a chauffer for $200? Enter 0 for"
+ " yes and 1 for no");
chauffer = keyboard.nextInt();

if(chauffer!=1)
total = dFee;
else
total = dFee + 100;
}
}

package CarRental;
import java.util.*;
public class UseCarRental
{
public static void main(String args[])
{
String name, size;
int zipcode, days;

Scanner keyboard = new Scanner(System.in);

System.out.println("Enter total days you plan on renting: ");
days = keyboard.nextInt();

System.out.println("Enter your name: ");
name = keyboard.next();

System.out.println("Enter your billing zipcode: ");
zipcode = keyboard.nextInt();

System.out.println("Enter the size of the car: ");
size = keyboard.next();

CarRental economy = new CarRental(size);
economy.calculateTotal(days);
economy.print();

LuxaryCarRental fullsize = new LuxaryCarRental(size, days);
fullsize.CalculateTotalN();
fullsize.print();

}

Answers

Answer:

Here is the corrected code: The screenshot of the program along with its output is attached. The comments are written with each line of the program for better understanding of the code.

CarRental.java

public class CarRental  {  //class name

//below are the data members name, zipcode, size, dFee, days and total

String name;  

int zipcode;

String size;

double dFee;

int days;

double total;  

public String getName()  {  //accessor method to get the name

return name; }

public int getZipcode()  { //accessor method to get the zipcode

return zipcode; }

public String getSize() {  //accessor method to get the size

return size; }

public int getDays() {  //accessor method to get the days

return days;  }

public CarRental(String size)  {  //constructor of CarRental class

if(size.charAt(0)=='e')  // checks if the first element (at 0th index) of size data member is e

     dFee = 29.99;  // sets the dFee to 29.99

  else if(size.charAt(0)=='m')  // checks if the first element (at 0th index) of size data member is m

     dFee = 38.99;  // sets the dFee to 38.99

  else   // checks if the first element (at 0th index) of size data member is f

     dFee =43.50;  // sets the dFee to 43.50

   }

public void calculateTotal(int days) {  //method calculateTotal of CarRental

total = dFee*days;  }  //computes the rental fee

public void print()   {  //method to display the total rental fee

System.out.println("Your rental total cost is: $" + total);  } }

Explanation:

LuxuryCarRental.java

import java.util.*;

public class LuxuryCarRental extends CarRental {  //class LuxuryCarRental that is derived from class CarRental

public LuxuryCarRental(String size, int days) {  // constructor of LuxuryCarRental

super(size);}   //used when a LuxuryCarRental class and CarRental  class has same data members i.e. size

public void calculateTotal() {  //overridden method

super.calculateTotal(days); // used because CarRental  and LuxuryCarRental class have same named method i.e.  calculateTotal

dFee = 79.99;  //sets the rental fee at $79.99 per day

total = dFee;  }  //sets total to rental fee value

public void print(){  //overridden method

   int chauffeur;  // to decide to include chauffeur

Scanner keyboard = new Scanner(System.in);  //used to take input from user

System.out.println("Do you want to add a chauffeur for $200? Enter 0 for"

+ " yes and 1 for no");  // prompts the user to respond to the option of including a chauffeur at $200 more per day

chauffeur = keyboard.nextInt();   //reads the input option of chauffeur from user

if(chauffeur==1)  //if user enters 1 which means user does not want to add a chauffeur

total = dFee;  //then set the value of dFee i.e.  $79.99  to total

else  //if user enters 0 which means user wants to add a chauffeur

total = dFee + 200;  //adds 200 to dFee value and assign the resultant value to total variable

System.out.println("Your rental total cost is: $" + total);  }  } //display the total rental fee

UseCarRental.java

import java.util.*;

public class UseCarRental{ //class name

public static void main(String[] args){ //start of main() function body

String name, size; // declare variables

int zipcode, days; //declare variables

Scanner keyboard = new Scanner(System.in); // to take input from user

System.out.println("Enter total days you plan on renting: "); //prompts user to enter total days of rent

days = keyboard.nextInt(); // reads value of days from user

System.out.println("Enter your name: "); //prompts user to enter name

name = keyboard.next(); //reads input name from user

System.out.println("Enter your billing zipcode: "); // prompts user to enter zipcode

zipcode = keyboard.nextInt(); //reads input zipcode from user

System.out.println("Enter the size of the car: "); // prompts user to enter the value of size

size = keyboard.next(); //reads input size from user

CarRental economy = new CarRental(size); //creates an object i.e. economy of class CarRental

economy.calculateTotal(days); //calls calculateTotal method of CarRental using instance economy

economy.print(); //calls print() method of CarRental using instance economy

LuxuryCarRental fullsize = new LuxuryCarRental(size, days);  //creates an object i.e. fullsize of class LuxuryCarRental

fullsize.calculateTotal();  //calls calculateTotal method of LuxuryCarRental using instance fullsize

fullsize.print(); }} //calls print() method of LuxuryCarRental using instance fullsize      

Enum fruit_tag {
BLUEBERRY,
BANANA,
PINEAPPLE,
WATERMELON
};
typedef enum fruit_tag fruit_t;
void printFruit(fruit_t myFruit) {
switch(myFruit) {
case BLUEBERRY:
printf("a blueberry");
break;
case BANANA:
printf("a banana");
break;
case PINEAPPLE:
printf("a pineapple");
break;
case WATERMELON:
printf("a watermelon");
break;
}
}
void compareFruit(fruit_t fruit1, fruit_t fruit2) {
if (fruit1 > fruit2) {
printFruit(fruit1);
printf(" is larger than ");
printFruit(fruit2);
}
else {
printFruit(fruit1);
printf(" is smaller than ");
printFruit(fruit2);
}
}
int main(void) {
fruit_t myFruit = PINEAPPLE;
fruit_t otherFruit = BLUEBERRY;
compareFruit(myFruit, otherFruit);
return 0;
What is the output?

Answers

Answer:

The output is "a pineapple is larger than a blueberry ".

Explanation:

In the given  C language code Enum, typedef, and two methods "printfruit and compareFruit" is declared, that can be defined as follows:

In the enum "fruit_tag" there are multiple fruit name is declared that use as the datatypes. In the next line, the typedef is defined, that enum to define another datatype that is "fruit_t". In the next step, the printFruit method is defined that accepts "myFruit" variable in its parameter and use the switch case to to check value. In the "compareFruit" method, it accepts two parameters and uses the if-else block to check its parameters value and print its value. In the main method,  two variable "myFruit and otherFruit" variable is declared that stores the values and pass into the "compareFruit" method and call the method.

When you start your computer then which component works first?

Answers

Bios is normally the first software, which is used to initiate connections to the hardware and perform testing and configuration. Then the OS is detected and the whole kernel is handed off to load the OS itself.

Can someone compress this ipv6 address? 558c:0000:0000:d367:7c8e:1216:0000:66be

Answers

558c::d367:7c8e:1216:0:66be

Write a Python program stored in a file q1.py to play Rock-Paper-Scissors. In this game, two players count aloud to three, swinging their hand in a fist each time. When both players say three, the players throw one of three gestures: Rock beats scissors Scissors beats paper Paper beats rock Your task is to have a user play Rock-Paper-Scissors against a computer opponent that randomly picks a throw. You will ask the user how many points are required to win the game. The Rock-Paper-Scissors game is composed of rounds, where the winner of a round scores a single point. The user and computer play the game until the desired number of points to win the game is reached. Note: Within a round, if there is a tie (i.e., the user picks the same throw as the computer), prompt the user to throw again and generate a new throw for the computer. The computer and user continue throwing until there is a winner for the round.

Answers

Answer:

The program is as follows:

import random

print("Rock\nPaper\nScissors")

points = int(input("Points to win the game: "))

player_point = 0; computer_point = 0

while player_point != points and computer_point != points:

   computer = random.choice(['Rock', 'Paper', 'Scissors'])

   player = input('Choose: ')

   if player == computer:

       print('A tie - Both players chose '+player)

   elif (player.lower() == "Rock".lower() and computer.lower() == "Scissors".lower()) or (player.lower() == "Paper".lower() and computer.lower() == "Rock".lower()) or (player == "Scissors" and computer.lower() == "Paper".lower()):

       print('Player won! '+player +' beats '+computer)

       player_point+=1

   else:

       print('Computer won! '+computer+' beats '+player)

       computer_point+=1

print("Player:",player_point)

print("Computer:",computer_point)

Explanation:

This imports the random module

import random

This prints the three possible selections

print("Rock\nPaper\nScissors")

This gets input for the number of points to win

points = int(input("Points to win the game: "))

This initializes the player and the computer point to 0

player_point = 0; computer_point = 0

The following loop is repeated until the player or the computer gets to the winning point

while player_point != points and computer_point != points:

The computer makes selection

   computer = random.choice(['Rock', 'Paper', 'Scissors'])

The player enters his selection

   player = input('Choose: ')

If both selections are the same, then there is a tie

   if player == computer:

       print('A tie - Both players chose '+player)

If otherwise, further comparison is made

   elif (player.lower() == "Rock".lower() and computer.lower() == "Scissors".lower()) or (player.lower() == "Paper".lower() and computer.lower() == "Rock".lower()) or (player == "Scissors" and computer.lower() == "Paper".lower()):

If the player wins, then the player's point is incremented by 1

       print('Player won! '+player +' beats '+computer)

       player_point+=1

If the computer wins, then the computer's point is incremented by 1

   else:

       print('Computer won! '+computer+' beats '+player)

       computer_point+=1

At the end of the game, the player's and the computer's points are printed

print("Player:",player_point)

print("Computer:",computer_point)

1. Describe your Microsoft word skills that need to be improved upon the most. 2. Explain the Microsoft word skills you are most confident in performing. 3. How can your Microsoft word processing skills affect your overall writing skills on the job?

Answers

Answer:

The answer varies from person to person.

Explanation:

All kinds of people are using Word, so people would recognize if the answer if plagiarized. So, simply answer truthfully; no matter h1ow embarrasing.

The Microsoft word skills that I will need to improve upon the most is how to be faster when typing.

It should be noted that the Microsoft word skill that I am mostly confident in performing is the creation of word documents and text formatting.

Lastly, Microsoft word processing skills have affected my overall writing skills on the job as it has helped in improving my writing and grammar.

Learn more about Microsoft on:

https://brainly.com/question/20659068

Write a program that reads in your question #2 Python source code file and counts the occurrence of each keyword in the file. Your program should prompt the user to enter the Python source code filename

Answers

Answer:

Here is the Python program:

import keyword  #module that contains list of keywords of python

filename = input("Enter Python source code filename: ") # prompts user to enter the filename of a source code

code = open(filename, "r") # opens the file in read mode

keywords = keyword.kwlist #extract list of all keywords of Python and stored it into keywords

dictionary = dict() #creates a dictionary to store each keyword and its number of occurrence in source code

for statement in code: # iterates through each line of the source code in the file

   statement = statement.strip() # removes the spaces in the statement of source code  

   words = statement.split(" ") #break each statement of the source code into a list of words by empty space separator

   for word in words:# iterates through each word/item of the words list  

       if word in keywords:#checks if word in the code is present in the keywords list of Python  

           if word in dictionary: #checks if word is already present in the dictionary

               dictionary[word] = dictionary[word] + 1 #if word is present in dictionary add one to the count of the existing word

           else: #if word is not already present in the dictionary  

               dictionary[word] = 1 #add the word to the dictionary and set the count of word to 1

for key in list(dictionary.keys()): #iterates through each word in the list of all keys in dictionary  

   print(key, ":", dictionary[key])# prints keyword: occurrences in key:value format of dict

Explanation:

The program is well explained in the comments attached with each line of the program.  

The program prompts the user to enter the name of the file that contains the Python source code. Then the file is opened in read mode using open() method.

Then the keyword.kwlist statement contains the list of all keywords of Python. These are stored in keywords.

Then a dictionary is created which is used to store the words from the source code that are the keywords along with their number of occurrences in the file.

Then source code is split into the lines (statements) and the first for loop iterates through each line and removes the spaces in the statement of source code .

Then the lines are split into a list of words using split() method. The second for loop is used to iterate through each word in the list of words of the source code. Now each word is matched with the list of keywords of Python that is stored in keywords. If a word in the source code of the file is present in the keywords then that word is added to the dictionary and the count of that word is set to 1. If the word is already present in the dictionary. For example if there are 3 "import" keywords in the source code and if 1 of the import keywords is already in the dictionary. So when the second import keyword is found, then the count of that keyword is increased by 1 so that becomes 2.

Then the last loop is used to print each word of the Python that is a keyword along with its number of occurrences in the file.

The program and its output is attached in a screenshot. I have used this program as source code file.

The invention of the integrated circuit was the first major advance in computing. The integrated circuit made it possible for all of a computer's electrical components to reside on one silicon chip.

This invention became known as the __________.


personal computer


microprocessor


client-server configuration


mainframe computer

Answers

Answer:

micro processor

Explanation:

The breastbone or ________________ extends down the chest.

Answers

Answer:

The sternum or breastbone is a long flat bone located in the central part of the chest.

The sternum or breastbone is a long flat bone located in the central part of the chest.

In the middle of the chest, there is a long, flat bone known as the sternum or breastbone. It forms the front of the rib cage and is joined to the ribs by cartilage, assisting in the protection of the heart, lungs, and major blood arteries from harm. It is one of the longest and largest flat bones in the body, somewhat resembling a necktie. The manubrium, body, and xiphoid process are its three regions.

Therefore, the sternum or breastbone is a long flat bone located in the central part of the chest.

Learn more about the breastbone here:

https://brainly.com/question/32917871.

#SPJ2

WHICH PROGRAMMING LANGUAGES ARE THE BEST FOR PROGRAMMING?

Answers

Answer:

python is probably the best is you are a begginer

java and C++ are good too

Generating a signature with RSA alone on a long message would be too slow (presumably using cipher block chaining). Suppose we could do division quickly. Would it be reasonable to compute an RSA signature on a long message by first finding what the message equals (taking the message as a big integer), mod n, and signing that?

Answers

Answer:

Following are the algorithm to this question:

Explanation:

In the RSA algorithm can be defined as follows:  

In this algorithm, we select two separate prime numbers that are the "P and Q", To protection purposes, both p and q combines are supposed to become dynamically chosen but must be similar in scale but 'unique in length' so render it easier to influence. Its value can be found by the main analysis effectively.  

Computing N = PQ.  

In this, N can be used for key pair, that is public and private together as the unit and the Length was its key length, normally is spoken bits. Measure,

[tex]\lambda (N) = \ lcm( \lambda (P), \lambda (Q)) = \ lcm(P- 1, Q - 1)[/tex]  where [tex]\lambda[/tex] is the total function of Carmichaels. It is a privately held value. Selecting the integer E to be relatively prime from [tex]1<E < \lambda (N)[/tex]and [tex]gcd(E, \lambda (N) ) = 1;[/tex] that is [tex]E \ \ and \ \ \lambda (N)[/tex].  D was its complex number equivalent to E (modulo [tex]\lambda (N)[/tex] ); that is d was its design multiplicative equivalent of E-1.  

It's more evident as a fix for d provided of DE ≡ 1 (modulo [tex]\lambda (N)[/tex] ).E with an automatic warning latitude or little mass of bigging contribute most frequently to 216 + 1 = 65,537 more qualified encrypted data.

In some situations it's was shown that far lower E values (such as 3) are less stable.  

E is eligible as a supporter of the public key.  

D is retained as the personal supporter of its key.  

Its digital signature was its module N and the assistance for the community (or authentication). Its secret key includes that modulus N and coded (or decoding) sponsor D, that must be kept private. P, Q, and [tex]\lambda (N)[/tex] will also be confined as they can be used in measuring D. The Euler totient operates [tex]\varphi (N) = (P-1)(Q - 1)[/tex] however, could even, as mentioned throughout the initial RSA paper, have been used to compute the private exponent D rather than λ(N).

It applies because [tex]\varphi (N)[/tex], which can always be split into  [tex]\lambda (N)[/tex], and thus any D satisfying DE ≡ 1, it can also satisfy (mod  [tex]\lambda (N)[/tex]). It works because [tex]\varphi (N)[/tex], will always be divided by [tex]\varphi (N)[/tex],. That d issue, in this case, measurement provides a result which is larger than necessary (i.e. D >   [tex]\lambda (N)[/tex] ) for time - to - time). Many RSA frameworks assume notation are generated either by methodology, however, some concepts like fips, 186-4, may demand that D<   [tex]\lambda (N)[/tex]. if they use a private follower D, rather than by streamlined decoding method mostly based on a china rest theorem. Every sensitive "over-sized" exponential which does not cooperate may always be reduced to a shorter corresponding exponential by modulo  [tex]\lambda (N)[/tex].

As there are common threads (P− 1) and (Q – 1) which are present throughout the [tex]N-1 = PQ-1 = (P -1)(Q - 1)+ (P-1) + (Q- 1))[/tex], it's also possible, if there are any, for all the common factors [tex](P -1) \ \ \ and \ \ (Q - 1)[/tex]to become very small, if necessary.  

Indication: Its original writers of RSA articles conduct their main age range by choosing E as a modular D-reverse (module [tex]\varphi (N)[/tex]) multiplying. Because a low value (e.g. 65,537) is beneficial for E to improve the testing purpose, existing RSA implementation, such as PKCS#1, rather use E and compute D.

Other Questions
Jacob Corcoran bought 10,000 shares of Grebe Corporation stock two years ago for $24,000. Last year, Jacob received a nontaxable stock dividend of 2,000 shares in Grebe Corporation. In the current tax year, Jacob sold all of the stock received as a dividend for $18,000. Required:a. Complete the letter to Jacob describing the tax consequences of the stock sale.b. Prepare a memo for the tax research file describing the tax consequences of the stock sale.c. Please help.. Offering 25 points and 5 stars with a thanks Is it safe to eat an impossible whopper during constipation? Read this excerpt from the preamble of the Declaration of Independence:Prudence, indeed, will dictate that Governments longestablished should not be changed for light and transientcauses...How does the author appeal to ethos here?O A. By using strong words like dictate and established that evokeemotionO B. By arguing that since governments should not be changed, theywill not change the governmentO C. By saying that the declaration's signers are sensible men who arenot taking the change lightlyO D. By capitalizing Governments to show respect for the king 14. Simplify the expressionsa. 12 - 5y + 21 + y -23 help with 57, please!! 35\40 = 7\?a. 5 b. 8 c. 1 d. 4 Create one original post that responds to the following questions: Have you ever had a secret? Are secrets hard to keep? Why or why not? Can keeping secrets be a negative experience? Create two response posts that Contribute meaningfully to the original post of a classmate. I need help with this! where do you expect to participate in distance learning from? Please give me the correct answer No one has been able to satisfactorily explain how or The Moon sporadically sparks.a. when b. why c. what d. which Someone please help! Thank you Which activity can substantially increase a persons risk of contracting HIV infection? A.having sex with a condom with an uninfected partnerB.getting a massage from an infected personC.having unprotected sex with an infected personD.having dinner with a group of infected people Find the point(s) on the ellipse x = 3 cost, y = sin t, 0 less than or equal to t less than or equal to 2pi closest to the point(4/3,0) (Hint: Minimize the square of the distance as a function of t.) The point(s) on the ellipse closest to the given point is(are) . (Type ordered pairs. Use a comma to separate answers as needed.) In this activity, you will write a travel blog post in Spanish describing a trip that you have taken in the past. Include both past tenses, the imperfecto and the pretrito. Use vocabulary related to travel. Submit the response to your teacher. Why did Katherine do better when she raised her prices and refused to sell on credit? Without the discovery of magnetic reversals recorded on the ocean floor, scientistsA. could not confirm the usefulness of sonarB. could destroy the hypothasis of continental driftC. could not provide a mechanism for moving continentsD. could explain how the seafloor was being destroyed Brady read this on a pamphlet at the dentist's office. Shinybrite is the best toothpaste on the market! Eight out of ten patients who tried Shinybrite Minty Creme liked it better than the leading brand of toothpaste. Shinybrite whitens teeth and freshens breath. Regular toothbrushing decreases cavities and gum disease. What is the writer's opinion, and what evidence is used to support it? The writer's opinion is that Shinybrite whitens teeth. It is supported with the statistic that eight out of ten patients like it more than the leading brand. The writer's opinion is that Shinybrite is the best toothpaste. It is supported with the statistic that eight out of ten patients like it more than the leading brand. The writer's opinion is that regular brushing decreases cavities. It is supported with the fact that toothbrushing decreases gum disease. The writer's opinion is that the toothpaste freshens breath. It is supported by the fact that Shinybrite is the best toothpaste on the market. Is it ethical for a professor to deny a student an opportunity to write exam since he or she's late n didn't write his or her assignments then allowing other students to write an exam while they are also late , reasons plss