1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
aleksandrvk [35]
2 years ago
14

PLEASE HELP me with at least 1 of the problems in the picture We are coding using python​

Computers and Technology
1 answer:
Ivenika [448]2 years ago
3 0

Answer:

Python is a flexible programming language that is used for teaching machines to learn and for analyzing extensive amounts of data. Python is also used in AI creation. Its simple syntax and a wide variety of frameworks with hundreds of source codes allow AI creators to use it.

Explanation:

You might be interested in
Define a member function PrintAll() for class PetData that prints output as follows. Hint: Make use of the base class' PrintAll(
PilotLPTM [1.2K]

Answer:

Following are the program in the C++ Programming Language.

//set header file

#include <iostream>

//set header file for string

#include <string>

//set namespace

using namespace std;

//define class

class AnimalData

{

//set access modifier

public:

//define function

void SetName(string givenName)

{

//initialize the value of function's argument

fullName = givenName;

};

//define function

void SetAge(int numYears)

{

//initialize the value of function's argument

ageYears = numYears;

};  

//here is the solution

//define function

void PrintAll()

{

//print output with message

cout << "Name: " << fullName<<endl;

//print output with message

cout << "Age: " << ageYears<<endl;

};

//set access modifier

private:

//set integer data type variable

int ageYears;

//set string data type variable

string fullName;

};

//define class and inherit the parent class

class PetData: public AnimalData

{

//set access modifier

public:

//define function

void SetID(int petID)

{

idNum = petID;

};

//override the function for print id

void PrintAll()

{

AnimalData::PrintAll();

cout << "ID: " <<idNum ;

};

//set access modifier

private:

//set integer type variables

int idNum,fullName,ageYears;

};

//define main method

int main()

{

//create object of the child class

PetData userPet;

//call function through object

userPet.SetName("Fluffy");

//call function through object

userPet.SetAge (5);

//call function through object

userPet.SetID (4444);

//call function through object

userPet.PrintAll();

cout << endl;

return 0;

}

<u>Output</u>:

Name: Fluffy

Age: 5

ID: 4444

Explanation:

<u>Following are the description of the program</u>:

  • Set required header file and namespace.
  • Define class 'AnimalData' and inside the class, set integer data type variable 'ageYears', string data type variable 'fullName'.
  1. Then, define function 'SetName()' with string data type argument 'givenName' and initialize the value of argument in the string variable.
  2. Then, define function 'SetAge()' with integer data type argument 'numYears' and initialize the value of the argument in the integer variable.
  3. Define function 'PrintAll()' to print the value of the following variables with message.
  • Define class 'PetData' and inherit the parent class in it, then set integer data type variable 'idNum'.
  1. Then, define function 'SetID()' with integer data type argument 'petID' and initialize the value of the argument in the integer variable.
  2. Override the function 'PrintAll()' to print the value of the following variable with message.

Finally, define main method and create the object of the child class, then call the following functions through the class object.

8 0
2 years ago
a _____ is a recreation of a thumbnail in a desktop publishing software, also known as a "rough". a. proof b. digital draft c. l
Dmitrij [34]
D. It’s a sketch. That is, if you talking about, an art piece.
6 0
3 years ago
Compare the two types of formatting that IDE devices must go through. What is the primary difference between the two?
Andrei [34K]
A quick format<span> changes the file system while the </span>full format<span> also checks the </span>drive for bad sectors.  <span>The scan for bad sectors is the reason why the Full </span>format<span> takes twice as long as the </span>Quick format<span>. If you choose the </span>Quick format<span> option, the </span>format<span> removes address files from the partition, but does not scan the disk for bad sectors.</span>
7 0
3 years ago
Read 2 more answers
What are the benefits of transferable skills check all the boxes that apply
Nonamiya [84]

Answer:

They allow easy cross-company transfers.

They help a person develop self-esteem.

They open up a variety of employment options.

Explanation:

7 0
3 years ago
Read 2 more answers
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
mestny [16]

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.

8 0
3 years ago
Other questions:
  • How many possible password of length four to eight symbols can be formed using English alphabets both upper and lower case (A-Z
    11·1 answer
  • In Java an abstract class cannot be sub-classed<br><br> ?? True<br><br> ?? False
    8·1 answer
  • Individuals who require better speed and performance for graphics-intensive applications (e.g., video editing, gaming, etc.) pre
    8·1 answer
  • Wide area network (WAN) connects multiple networks that are in the same geographical locations.
    6·1 answer
  • Which of these is an aggregator?
    9·2 answers
  • A chief Information Security Officer (CISO) is performing a BIA for the organization in case of a natural disaster. Which of the
    8·1 answer
  • Question 21 pts How many lines should an email signature be? Group of answer choices "5 to 6" "7 to 8" "1 to 2" "3 to 4"
    10·1 answer
  • This describes what is charted. It can be placed above or below the chart.
    12·1 answer
  • How to fix a light blub
    11·2 answers
  • Sara wants to set up her lights to turn on when she arrives home. She has heard that she might be able to do this using IoT. Wha
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!