Write a function called matches that takes two int arrays and their respective sizes, and returns the number of consecutive values that match between the two arrays starting at index 0. Suppose the two arrays are {3, 2, 5, 6, 1, 3} and {3, 2, 5, 2, 6, 1, 3} then the function should return 3 since the consecutive matches are for values 3, 2, and 5.

Answers

Answer 1

Answer:

Written in C++

int matches(int arr1[], int arr2[], int k) {

   int count = 0;

   int length = k;

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

       if(arr1[i] == arr2[i])         {

           count++;

       }

   }

   return count;

}

Explanation:

This line defines the function

int matches(int arr1[], int arr2[], int k) {

This line initializes count to 0

   int count = 0;

This line initializes length to k

   int length = k;

This line iterates through the array

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

The following if statement checks for matches

       if(arr1[i] == arr2[i])         {

           count++;

       }

   }

This returns the number of matches

   return count;

}

See attachment for complete program


Related Questions

Your friend is using Internet Explorer to send and receive email using her Hotmail account. She received a Word document attached to an email message from a business associate. She double-clicked the Word attachment and spent a couple of hours editing it, saving the document as she worked. Then she closed the document. But where’s the document now? When she later needed it, she searched her email account online and the Documents folder on her hard drive, but she could not find the document. She called you in a panic asking you to help her find her lost document.

Answers

Answer:

Temporary Internet Files folder

Explanation:

Assuming that your friend is using the Microsoft Windows 10 operating system, then this document would have gotten saved in the Temporary Internet Files folder within the operating system. This folder can be located within the following address in the operating system

C:\Users\[username]\AppData\Local\Microsoft\Windows\INetCache

Navigating to this address would help you find the folder and inside that should be the Microsoft Word document that you have used in your Internet Explorer Browser. This folder is where all browser files get saved when they are not explicitly downloaded to a specific folder but are still used within the browser.

Ms. Myers commented that _____ she slept in at the hotel was better than _____ she slept in at home.

Answers

The bed/ the bed is the answer

Compare the ufw status verbose command output with Windows Firewall with the Advanced Security Windows Firewall Properties you investigated in an earlier lab. Describe the major similarities that you observe.

Answers

Answer:

Following are the solution to this question:

Explanation:

Its common factor between both the ufw state glib collection consisted of times more likely Protection View Firewall Property is that they demonstrate the status of the network. So, the consumer sees that path could go to next.

The following are the command which is defined in the attached file.

Select the items that you may see on a Windows desktop.
Shortcuts to frequently used programs
System tray
Recycle Bin
Taskbar
O Database
Icons
O Quick Launch

Answers

Answer:

You may see:

The taskbar

The startmenu

Program icons within the taskbar

Shortcuts

Documents

Folders

Media files

Text files

The Recycle Bin

and so on...

Two middle-order batsmen are compared based on their performance in their previous cricket match.
Batsman A got 9 runs more than Batsman B and Batsman A's runs are 56% of the sum of both their runs.
What runs did Batsman A and B score, respectively?

Answers

How many points is this for

Write a function, maxRadius, to find an index of a Planet with the largest radius in the array. The function should

Answers

Answer:

Follows are the code to this question:

#include<iostream>//defining header file

#include<string>//defining header file

using namespace std;

const double Pi =3.141592653589793238463;//defining double constant variable

class Planet  

{

private:

string planet_name;//defining string variable

double radius;//defining double variable

public:

Planet()//defining default constructor

{

this->planet_name="";//use this keyword to hold value

this->radius=0.0;//use this keyword to hold value

}

Planet(string name, double radius)//defining parameterized constructor  

{

this->planet_name = name;//use this keyword to hold value

this->radius=radius;//use this keyword to hold value

}

string getName() const//defining getName method  

{

return this->planet_name;//use return keyword for return string value

}

double getRadius() const//defining getRadius method  

{

return this->radius;//use return keyword for return radius value

}

double getVolume() const //defining getVolume method

{

return 4*radius*radius*radius*Pi/3;////use return keyword for return volume value

}

};

int maxRadius(Planet* planets, int s)//defining a method maxRadius that accept two parameter

{

double maxRadius=0;//defining double variable

int index_of_max_radius=-1;//defining integer variable

for(int index=0; index<s; index++)//defining for loop for calculate index of radius  

{

if(planets[index].getRadius()>maxRadius)//defining if block to check radius

{

maxRadius = planets[index].getRadius();//use maxRadius to hold value

index_of_max_radius=index;//hold index value

}

}

return index_of_max_radius;//return index value

}

int main()//defining main method

{

Planet planets[5];//defining array as class name

planets[0] = Planet("On A Cob Planet",1234);//use array to assign value  

planets[1] = Planet("Bird World",4321);//use array to assign value

int idx = maxRadius(planets,2);//defining integer variable call method maxRadius

cout<<planets[idx].getName()<<endl;//print value by calling getName method

cout<<planets[idx].getRadius()<<endl;//print value by calling getRadius method

cout<<planets[idx].getVolume()<<endl;//print value by calling getVolume method

}

Output:

Bird World

4321

3.37941e+11

Explanation:

please find the complete question in the attached file:

In the above-program code, a double constant variable "Pi" is defined that holds a value, in the next step, a class "Planet" is defined, in the class a default and parameter constructor that is defined that hold values.

In the next step, a get method is used that return value, that is "planet_name, radius, and volume".

In the next step, a method "maxRadius" is defined that accepts two-parameter and calculate the index value, in the main method class type array is defined, and use an array to hold value and defined "idx" to call "maxRadius" method and use print method to call get method.  

If a command was taking a large amount of system resources (memory and processing) and this was causing some system performance issues, what could a system administrator do to solve the problem?

Answers

Answer:

They can delete some tabs so less resources go to RAM

Explanation:

It depends on how many cores you have, your clock speed etc, when you have a lot of tabs open then your computer sends some files to RAM to be stored for a little while whilst it clears up some of its files. So therefore, delete/move some files so less files can be transported to RAM.

Match the term to its use in creating perspective.

1. placement
2. size
3. color
4. converging lines

A. Lines merging into a distance create
an illusion of depth.

B. The position of a shape relative to the
horizon affects your perception of depth.

C. Adds spatial depth to a shape.

D. A smaller shape, placed appropriately,
appears more distant than a similar
larger shape.

Answers

Answer:

1. POSITION - The position of a shape relative to the

horizon affects your perception of depth.

2. CONVERGING LINES- Lines merging into a distance create

an illusion of depth.

3.COLOR- Adds spatial depth to a shape.

4. SIZE - A smaller shape, placed appropriately,

appears more distant than a similar

larger shape.

took test on PLATO. 100%

To what does the term "versioning information" refer?
O the version of software that a system is running
the version of your monitor
the number of versions of a virus you have
the version of your PC

Answers

Answer:

The answer to this question is given below in the explanation section.

Explanation:

The versioning information refers to the version of the software that a system is running. Versioning of software is the creation and managing of multiple releases of software that all have the same general functionality but improved, modified, upgraded, and customized.

so the correct answer to this question is version information refers to the version of a software that a system is running.  

Other options are not correct, because the term version mostly used for software, web application, and web, API services.

The best term use for a version of monitor and PC is model number and also noted that virus detecting software can have version number but the virus itself doesn't have any version number.

So all other options of this question are incorrect except the first option that is:- Versioning information refers to the version of the software that a system is running.

CJ is developing a new website blogging about cutting-edge technologies for people with special needs. He wants to make the site accessible and user friendly.
CJ knows that some of the visitors who frequent his website will use screen readers. To allow these users to bypass the navigation, he will use a skip link, He wants to position the skip link on the right but first he must use the ____ property.
a) display
b) right
c) left
d) nav

Answers

Answer:

The answer is "Option c".

Explanation:

It is an internal page reference which, whilst also completely new pages, allow navigating around the current page. They are largely used only for bypassing and 'skipping' across redundant web page content by voice command users, that's why the CJ would use a skip link to enable those users to bypass specific navigation, and he also wants to put this link on the right, but first, he needs to use the left property.

Write this program using an IDE. Comment and style the code according to CS 200 Style Guide. Submit the source code files (.java) below. Make sure your source files are encoded in UTF-8. Some strange compiler errors are due to the text encoding not being correct. This lab asks you to create a text game Rock Paper Scissors. The rule of the game: There are two players in this game and they can choose Rock, Paper, or Scissors each time. Rock beats Scissors, Paper beats Rock and Scissors beat Paper. Your program needs to prompt a user to choose an action (Rock, Paper, or Scissors) and save their choice. The program randomly chooses an action (Hint: use .nextInt() to generate random integers in the range of [1,3]. 1 indicates Rock, 2 indicates Paper and 3 indicates Scissors.) Then the program determines who is the winner.
When input is R Please select one of [R/P/S]: You chose: Rock I chose: Scissors Rock beats scissors - you win! If the user enters the lowercase, your program can still recognize. When input is p Output should be Please select one of [R/P/S]: You chose: Paper I chose: Scissors Scissors beat paper - you lose! If the user enters invalid input, the program will give an error message and set the default choice as Rock When input is v Output should be Please select one of [R/P/S]: Invalid choice! Defaulting to Rock. I chose: Scissors Rock beats scissors - you win! If the user has the same result as the computer, your program should output: A Tie!

Answers

Answer:

import java.util.Scanner; //to accept input from user

import java.util.Random; //to generate random numbers

public class Main { //class name

   public static void main(String[] args) { //main method

       System.out.println("Please select one of [R/P/S]: "); //prompts user to select a choice

       Scanner scanner = new Scanner(System.in); //reads input choice

       String playerChoice = scanner.next().toUpperCase().replace(" ", ""); //converts the choice to upper case and stores it in playerChoice

       if (playerChoice.equals("R") || playerChoice.equals("P") || playerChoice.equals("S")) { // if player choice is a valid choice

           results(CompChoice(), playerChoice);    // calls method to compute result of game

   } else { //if player enters invalid choice

      System.out.println("\nInvalid choice!");     }    }    //error message

   

   private static String CompChoice() {  //to generate computer choice  

           Random generator = new Random();  //to generate random numbers

           int comp = generator.nextInt(3)+1; //generates 3 random numbers

           String compChoice = "";  //to store computer choice

           switch (comp) { //checks the random number for corresponding computer choice

           case 1: //1 is for Rock

               compChoice = "Rock"; //sets compChoice to Rock

               break;

            case 2: //random  number 2 is for Paper

               compChoice = "Paper"; //sets compChoice to Paper

               break;

            case 3: //random  number 3 is for Scissors

               compChoice = "Scissors"; //sets compChoice to  Scissors

               break;         }        

       return compChoice;      } //returns computer choice

   

   private static void results(String compChoice, String playerChoice) { //method to compute result

        if(playerChoice.equals("R")) //if playerChoice is equal to R

       { playerChoice = "Rock"; //stores Rock to playerChoice

        System.out.println("You chose: Rock");} //displays player choice

        else if(playerChoice.equals("P")) //if playerChoice is equal to P

       { playerChoice = "Paper";        //stores Paper to playerChoice

               System.out.println("You chose: Paper");} //displays player choice

         else  //if playerChoice is equal to S

        { playerChoice="Scissors"; //stores Scissors to playerChoice

          System.out.println("You chose: Scissors"); }  //displays player choice

 System.out.println("I chose: " + compChoice); //displays computer choice

       if (compChoice.equals(playerChoice)) { //if compChoice is equal to playerChoice          

          System.out.println("a tie!"); //its a tie if computer and player choice is the same

          System.exit(1);  }//exits on tie    

        boolean youWin = false; //variable to check if player wins      

       if (compChoice.equals("Rock")) { //if computer choice is Rock

          if (playerChoice.equals("Paper")) //if player choice is Paper

          {System.out.println("Paper beats Rock.");

              youWin = true;} //player wins to youWin is set to true

        else if(playerChoice.equals("Scissors"))  { //if player choice is Scissors

              System.out.println("Rock beats scissors.");

              youWin = false;}     }   //player loses to youWin is set to false

       

       if (compChoice.equals("Paper")) { //if computer choice is Paper

          if (playerChoice.equals("Rock")) //if player choice is Rock

          {System.out.println("Paper beats Rock.");

              youWin = false;}  //player loses to youWin is set to false

         else if(playerChoice.equals("Scissors")) { //if player choice is Scissors

              System.out.println("Scissors beats Paper.");

              youWin = true;} }  //player wins to youWin is set to true    

       

       if (compChoice.equals("Scissors")) { //if computer choice is Scissors

          if (playerChoice.equals("Rock")) //if player choice is Rock

          {System.out.println("Rock beats Scissors.");

              youWin = true;} //player wins to youWin is set to true

         else if(playerChoice.equals("Paper")) { //if player choice is Paper

              System.out.println("Scissors beats Paper.");

              youWin = false;} }  //player loses to youWin is set to false

     

            if (youWin) //if player wins means if youWin is true

                System.out.println("you win!"); //declare player to be winner

           else //if player loses means if youWin is false

                System.out.println("you lose!");     } } //declare player to lose

                       

Explanation:

The program is well explained in the comments attache with each line of program. The program has three methods. One is the main method to start the game and prompts user to enter a choice and converts the user input choice to upper case. One is CompChoice method that generates three random numbers and uses switch statement to set 1 for Rock, 2 for Paper and 3 for Scissors . One method is results that takes computer choice and player choice as parameters to decide the winner. It uses if else statements to check if choice of user wins from choice of computer or vice versa. It uses a boolean variable youWin which is set to true when player choice beats computer choice otherwise is set to false. At the end if youWin is true then the player is declared winner otherwise not. The screenshot of the program output is attached.

Write a program that reads a list of words. Then, the program outputs those words and their frequencies. The input begins with an integer indicating the number of words that follow. Assume that the list will always contain fewer than 20 words.
Ex: If the input is:
5 hey hi Mark hi mark
the output is:
hey 1
hi 2
Mark 1
hi 2
mark 1
Hint: Use two arrays, one array for the strings and one array for the frequencies.

Answers

Answer:

Here is the JAVA program:

import java.util.Scanner;   //to accept input from user

public class Main {  //class name

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

      Scanner input = new Scanner(System.in);  //creates Scanner object

      int integer = input.nextInt();  //declares and reads the integer indicating the number of words

      String stringArray[] = new String[integer]; //creates array to hold strings

      for (int i = 0; i < integer; i++) {  //iterates through the array

          stringArray[i] = input.next();         }  //reads strings

      int frequency[] = new int[integer];  //creates array for frequencies

      int count;         //declares variable to count frequency of each word

      for (int i = 0; i < frequency.length; i++) {  //iterates through the frequency array

          count = 0;  //initializes count to 0

          for (int j = 0; j < frequency.length; j++) {  //iterates through array

              if (stringArray[i].equals(stringArray[j])) {  //if element at ith index of stringArray is equal to element at jth index of stringArray

                  count++;                 }            }  //adds 1 to the count

          frequency[i] = count;      }  //adds count to ith index of frequency array

      for (int i = 0; i < stringArray.length; i++) {  //iterates through the array

          System.out.println(stringArray[i] + " " + frequency[i]);         }    }    } //displays each word in stringArray and its corresponding frequency in frequency array

Explanation:

I will explain the program with an example:

let integer = 3

for (int i = 0; i < integer; i++) this loop is used to read input strings into stringArray.

At first iteration:

i = 0

0<3

stringArray[i] = input.next(); this reads a word and stores it to ith index of stringArray. Lets say user enters the string "hey" so hey is stored in stringArray[0]

i++ becomes i = 1

At second iteration:

i = 1

1<3

stringArray[i] = input.next(); this reads a word and stores it to ith index of stringArray. Lets say user enters the string "hi" so hi is stored in stringArray[1]

i++ becomes i = 2

At third iteration:

i = 2

2<3

stringArray[i] = input.next(); this reads a word and stores it to ith index of stringArray. Lets say user enters the string "hi" so hi is stored in stringArray[2]

i++ becomes i = 3

Now the loop breaks as i<integers evaluates to false.

Next the outer loop for (int i = 0; i < frequency.length; i++)

and inner loop for (int j = 0; j < frequency.length; j++)  iterate through the array and if condition if (stringArray[i].equals(stringArray[j])) checks if any of the words at specified indices is equal. This is used in order to check if any word in the list comes more than once. So if any word occurs more than once in the array, then its count is increased each time and the count value is stored in frequency[] array to store the count/frequency of each word in the stringArray. Since hey occurs once so its count is set to 1 and hi occurs twice so its frequency is set to 2. So the output of the entire program is:

hey 1

hi 2

hi 2

The screenshot of the program along with its output with the given example in question is attached.

When a variable is stored in memory, it is associated with an address. To obtain the address of a variable, the & operator can be used. For example, &a gets the memory address of variable a. Let's try some examples. Write a C program addressOfScalar.c by inserting the code below in the main function

Answers

Solution :

#include<stdio.h>

int main()

{

char charvar='\0';

printf("address of charvar = %p\n",(void*)(&charvar));

printf("address of charvar -1 = %p\n",(void*)(&charvar-1));

printf("address of charvar +1 = %p\n",(void*)(&charvar+1));

int intvar=1;

printf("address of intvar = %p\n",(void*)(&intvar));

printf("address of intvar -1 = %p\n",(void*)(&intvar-1));

printf("address of intvar +1 = %p\n",(void*)(&intvar+1));

}

C Write a program whose input is two integers, and whose output is the first integer and subsequent increments of 10 as long as the value is less than or equal to the second integer. Ex: If the input is: -15 30 the output is:

Answers

Answer:

Written in C Language

#include <stdio.h>

int main() {

   int num1, num2;

   printf("Enter two integers: ");

   scanf("%d", &num1);

   scanf("%d", &num2);

   if(num1 <= num2){

   for(int i = num1; i<= num2; i+=10)

   {

       printf("%d",i);   printf(" ");

   }    

   }

   return 0;

}

Explanation:

This line declares two integer variables

  int num1, num2;

This line prompts user for input of the two numbers

   printf("Enter two integers: ");

The next two lines get integer input from the user

   scanf("%d", &num1);

   scanf("%d", &num2);

The following if statement checks if num1 is less than or equal to num2

   if(num1 <= num2){

The following iteration prints from num1 to num2 at an increment of 10

   for(int i = num1; i<= num2; i+=10)

   {

       printf("%d",i);   printf(" ");

   }    

To write a letter using Word Online, which document layout should you choose? ASAP PLZ!

Answers

Traditional... See image below

Answer: new blank document

Explanation: trust is key

g Write a function called price_of_rocks. It has no parameters. In a while loop, get a rock type and a weight from the user. Keep a running total of the price for all requested rocks. Repeat until the user wants to quit. Quartz crystals cost $23 per pound. Garnets cost $160 per pound. Meteorite costs $15.50 per gram. Assume the user enters weights in the units as above. Return the total price of all of the material. For this discussion, you should first write pseudocode for how you would solve this problem (reference pseudocode.py in the Week 7 Coding Tutorials section for an example). Then write the code for how you would tackle this function. Please submit a Python file called rocks_discussion.py that defines the function (code) and calls it in main().

Answers

Answer:

The pseudocode:

FUNCTION price_of_rocks():

  SET total = 0

  while True:

      INPUT rock_type

      INPUT weight

      if rock_type is "Quartz crystals":

         SET total += weight * 23

      elif rock_type is "Garnets":

         SET total += weight * 160

      elif rock_type is "Meteorite":

         SET total += weight * 15.50

       

       INPUT choice

       if choice is "n":

           break

 

   RETURN total

END FUNCTION

The code:

def price_of_rocks():

   total = 0

   while True:

       rock_type = input("Enter rock type: ")

       weight = float(input("Enter weight: "))

       

       if rock_type == "Quartz crystals":

           total += weight * 23

       elif rock_type == "Garnets":

           total += weight * 160

       elif rock_type == "Meteorite":

           total += weight * 15.50

           

       choice = input("Continue? (y/n) ")

       if choice == "n":

           break

   

   return total

print(price_of_rocks())

Explanation:

Create a function named price_of_rocks that does not take any parameters

Initialize the total as 0

Create an indefinite while loop. Inside the loop:

Ask the user to enter the rock_type and weight

Check the rock_type. If it is "Quartz crystals", multiply weight by 23 and add it to the total (cumulative sum). If it is "Garnets", multiply weight by 160 and add it to the total (cumulative sum). If it is "Meteorite", multiply weight by 15.50 and add it to the total (cumulative sum).

Then, ask the user to continue or not. If s/he enters "n", stop the loop.

At the end of function return the total

In the main, call the price_of_rocks and print

Write a program that takes a three digit number (input) and prints its ones, tens and hundreds digits on separate lines

Answers

In python:

number = input("Enter your number ")

i = 0

while i < len(number):

   print(number[i])

   i += 1

Which syntax error in programming is unlikely to be highlighted by a compiler or an interpreter? a variable name misspelling a missing space a comma in place of a period a missing closing quotation mark

Answers

Answer:

A variable name misspelling.

Explanation:

A Syntax Error that occurs as the result of a variable name that is misspelled will not be highlighted.

On edg 2020

Answer:

A variable name misspelling.

Ex planation:

A

Reading for comprehension requires _____ reading?

1. passive
2. active
3. slow
4. fast

Answers

Answer:

IT is ACTIVE

Explanation: I took the quiz

Answer:

not sure sorry

Explanation:

Complete the do-while loop to output from 0 to the value of countLimit using printVal. Assume the user will only input a positive number. For example, if countLimit is 5 the output will be:
0
1
2
3
4
5
import java.util.Scanner;
public class CountToLimit {
public static void main (String [] args) {
Scanner scnr = new Scanner(System.in);
int countLimit = 0;
int printVal = 0;
// Get user input
countLimit = scnr.nextInt();
printVal = 0;
do {
System.out.print(printVal + " ");
printVal = printVal + 1;
} while ( /* Your solution goes here */ );
System.out.println("");
return;
}
}

Answers

Answer:

Replace

while ( /* Your solution goes here */ );

with

while (printVal <=countLimit );

Explanation:

while (printVal <=countLimit );

This checks if the printVal is less than or equal to countLimit.

While this statement is true, the program will continue printing the required output

See attachment for complete program

The hide/unhide feature only hides in the
_____ view?​

Answers

Answer: main...?

Explanation:

I don‘t know how to solve a crossword puzzle. Please help me!!!

Answers

Across would be words like: HELLO.
Vertically would be words like: H

E
Y

What is a piece of information sent to a function

Answers

Answer:

the information sent to a function is the 'input'.

or maybe not hehe

Edhesive 3.2 Lesson Practice question 1

Answers

value = float(input("Enter a number: "))

if value > 45.6:

   print("Greater than 45.6")

I hope this helps!

The program for the given output can be find in the explanation part which will show the answer "greater than 45.6" if the number exceeds than the digit.

What is computer programming?

The development of individual pieces of software that allow the entire system to function as a single unit is referred to as systems programming.

Many layers are involved in system programming, including the operating system (OS), firmware, and development environment.

The complexity of the instructions that computers comprehend is the primary reason why programming is considered difficult to learn. You cannot instruct computers in English or any other human language.

Individuals interested in becoming computer programmers must first obtain a degree in computer science, information technology, mathematics, or a related discipline.

value = float(input("Enter a number: "))

if value > 45.6:

print("Greater than 45.6")

Thus, above mentioned is the computer program that will give the required output.

For more details regarding computer programming, visit:

https://brainly.com/question/3397678

#SPJ5

what is a computer ?it types​

Answers

Answer:

A computer is a digital device that you can do things on such as play games, research something, do homework.

Explanation:

Answer:

A computer can be best described as an electronic device that works under the control of information stored in it's memory.

There are also types of computers which are;

Microcomputers/personal computerMini computersMainframe computerssuper computers

Write a program that takes as input a number of kilometers and prints the corresponding number of nautical miles.

Use the following approximations:

A kilometer represents 1/10,000 of the distance between the North Pole and the equator.
There are 90 degrees, containing 60 minutes of arc each, between the North Pole and the equator.
A nautical mile is 1 minute of an arc.

An example of the program input and output is shown below:

Enter the number of kilometers: 100
The number of nautical miles is 54

Answers

In python:

kilos = int(input("Enter the number of kilometers: "))

print(f"The number of nautical miles is {round(kilos/1.852,2)}")

I hope this helps!

For an input of 100 kilometers, the program displays "The number of nautical miles is 54.00."

To convert kilometers to nautical miles based on the given approximations.

Here are the simple steps to write the code:

1. Define a function called km_to_nautical_miles that takes the number of kilometers as input.

2. Multiply the number of kilometers by the conversion factor [tex](90 / (10000 \times 60))[/tex] to get the equivalent number of nautical miles.

3. Return the calculated value of nautical miles from the function.

4. Prompt the user to enter the number of kilometers they want to convert.

5. Read the user's input and store it in a variable called kilometers.

6. Call the km_to_nautical_miles function, passing the kilometers variable as an argument, to perform the conversion.

7. Store the calculated value of nautical miles in a variable called nautical_miles.

8. Display the result to the user using the print function, formatting the output string as desired.

Now the codes are:

def km_to_nautical_miles(km):

   nautical_miles = (km * 90) / (10000 * 60)

   return nautical_miles

kilometers = float(input("Enter the number of kilometers: "))

nautical_miles = km_to_nautical_miles(kilometers)

print(f"The number of nautical miles is {nautical_miles:.2f}.")

The output of this program is:

The result is displayed to the user as "The number of nautical miles is 54.00."

To learn more about programming visit:

https://brainly.com/question/14368396

#SPJ4

Works in the public domain have copyright that are expired or abandoned true or false

Answers

Answer:

False

Explanation:

Only one of the two are true. Works in the public domain have a copyright that has expired only. E.g. Works of classical music artist, are almost always expired, in accorance with American Copyright law. Abandoning a copyright doesn't do anything because so long the copyright has remained unexpired, the copyright remains. Thats why it can take decades for a new movie in a series to release, like "IT" by Stephen King. The copyright hasn't expired but rather was 'abandoned'. Before "IT" 2017 was relasesed, the copyright was abandoned.

Activity # 1
Write an algorithm and flowchart that will accept number of days and
displays the equivalent number of months and number of hours.
Where, 1 month has 30 days.




I need an answer for this one please

Answers

Answer:

input number of days d

       ↓

calculate number of months as d/30 rounded up

       ↓

display number of months

       ↓

calculate number of hours as d * 24

       ↓

display number of hours

Explanation:

The flowchart is pretty straightforward since there are no decisions to make.

For this lab you will do 2 things:


Solve the problem in an algorithm

Code it in Python

Problem:


Cookie Calories


A bag of cookies holds 40 cookies. The calorie information on the bag claims that there are 10 "servings" in the bag and that a serving equals 300 calories. Write a program that asks the user to input how many cookies he or she ate and the reports how many total calories were consumed.


*You MUST use constants to represent the number of cookies in the bag, number of servings, and number of calories per serving. Remember to put constants in all caps!


Make sure to declare and initialize all variables before using them!


Then you can do the math using those constants to find the number of calories in each cookie.


Make this program your own by personalizing the introduction and output.




Sample Output:


WELCOME TO THE CALORIE COUNTER!!

Answers

Answer:

Here is the Python program:

COOKIES_PER_BAG = 40 #sets constant value for bag of cookies

SERVINGS_PER_BAG = 10 #sets constant value for serving in bag

CALORIES_PER_SERVING = 300 #sets constant value servings per bag

cookies = int(input("How many cookies did you eat? ")) #prompts user to input how many cookies he or she ate

totalCalories = cookies * (CALORIES_PER_SERVING / (COOKIES_PER_BAG / SERVINGS_PER_BAG)); #computes total calories consumed by user

print("Total calories consumed:",totalCalories) #displays the computed value of totalCalories consumed

Explanation:

The algorithm is:

StartDeclare constants COOKIES_PER_BAG, SERVINGS_PER_BAG and CALORIES_PER_SERVINGSet COOKIES_PER_BAG to 40Set SERVINGS_PER_BAG to 10Set CALORIES_PER_SERVING to 300Input cookiesCalculate totalCalories:                                                                                                                       totalCalories ← cookies * (CALORIES_PER_SERVING / (COOKIES_PER_BAG / SERVINGS_PER_BAG))Display totalCalories

I will explain the program with an example:

Lets say user enters 5 as cookies he or she ate so

cookies = 5

Now total calories are computed as:

totalCalories = cookies * (CALORIES_PER_SERVING / (COOKIES_PER_BAG / SERVINGS_PER_BAG));  

This becomes:

totalCalories = 5 * (300/40/10)

totalCalories = 5 * (300/4)

totalCalories = 5 * 75

totalCalories = 375

The screenshot of program along with its output is attached.

What questions would you ask an employer at a job interview?

Answers

Answer:

8 Questions You Should Absolutely Ask An Interviewer

QUESTION #1: What do the day-to-day responsibilities of the role look like? ...

QUESTION #2: What are the company's values? ...

QUESTION #3: What's your favorite part about working at the company? ...

QUESTION #4: What does success look like in this position, and how do you measure it?

Explanation:

I hope this answer is Wright ,So please mark as brainlist answers

Other Questions
2. Which of the following does NOT contribute to globalization?a) Countries protect their trade positions by increasing tariffs on foreign importsb) Technological advances allow for decreased communications costsc) Containerization makes international shipping inexpensived) Countries ratify new free trade agreements point q is located in ( -4 , 6) point r is located in ( 8,6) . what is the distance from pint q to point r what is the mood of the song "let it go"?(im doing this analysis for honors class) What regions is Judaism still practiced today? How many people still practice it today? Rico's T-shirt Company sells customized short sleeve T shirts, long sleeve T-shirts, and sweatshirts. Each type of shirt sells in multiples of 5. It costs $25.00 for 5 short sleeve T-shirts, $30,00 for 5 long sleeve T-shirts, and $40.00 for 5 sweatshirts Short sleeve and long sleeve T shirts can be made in any color except navy or black Sweatshirts are only made in navy and black.. Mercedes bought green shirts for $55.00.. Quinn bought 10 navy sweatshirts, Rachel paid $30.00 for several red shirts, Hector bought black and yellow shirts for $65.00. Use the axioms to make three conclusions about the shirts sold. Simplify using order ofoperations.7(6 + 3) 4 x 5PEMDAS Lashawn solved the equation below to the determine the solution 3x-8=-x+4(x-2) Which triangle must be a right triangle and why?A'B'C' is right because it is the image of ABC.ADC is right because AA' intersects AC at A.BCC' is right because B lies of the line of reflection.BGC is right because Line E G is perpendicular-to CC'. whats the answer of 3/4 + 1/4 = President of the United States has scheduled a meeting today to discuss energy policy with specific focus on pollution and global warming. Given what you know of the executive branch, which group of attendees would the president most likely expect to provide up-to-date information and expert insight during this meeting. Which word would most likely be used in a descriptive scene about two people riding side by side on horses? Triangle JKL is shown below. Find the value of x. Signs and symptoms vary for sexually transmitted diseases true or false Which of the following is not a force? *gravityfrictiontensionacceleration Two angles are supplementary. One measures 3x-2 and the other measures 2x+7 Find the value of x and the measure of the smaller angle. Edmond measured a restaurant and made a scale drawing. The scale he used was7 centimeters : 6 meters. The restaurant's kitchen is 30 meters long in real life. How long isthe kitchen in the drawing? Eight more than the quotient of thirty and a number is fourteen. What is the relationship between the specific rotation of (2S ,3S)-dibromopentane and (2R, 3R)-dibromopentane?A) It is different in magnitude and opposite in sign B) it is equal in magnitude and have the same sign C) it is zero D) it is equal in magnitude but opposite in sign E) It is not possible to predict the specific rotation i need help please what is the x Can you help please