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
Aloiza [94]
3 years ago
15

Please help with my Python code - Functions

Computers and Technology
1 answer:
torisob [31]3 years ago
6 0

Answer:

Explanation:

See attached for assistance

You might be interested in
Where can we buy a cryptocurrency? from below options
dem82 [27]

it would be C

hope this helps!

8 0
3 years ago
You have installed a device that has eight interfaces and does not forward broadcast packets. What kind of device did you instal
Novay_Z [31]
A router, possibly. Thought I'm not for sure because I'm not in computers and technology

7 0
3 years ago
Read 2 more answers
A growling noise is heard only when the driver exerts force on the clutch pedal. No noise is heard when the clutch pedal is up.
Harrizon [31]

Answer:

answer a

Explanation:

the pilot bearing isnt moveing there fore makeing a nose

7 0
3 years ago
Suppose your SOHO network connects to the Internet using cable modem. When you open your browser and try to access a web site, y
pantera1 [17]

Answer:

a) you must identify your operating system. Follow the instructions of your operating system.

b) Delete the browsing history in Internet Explorer, follow these steps:

Start Internet Explorer from the desktop.

Press Alt to display the menu bar.

On the Tools menu, click Internet Options.

Select all the checkboxes then click Remove.

Explanation:

Restart Internet Explorer and try it.

5 0
4 years ago
Write a console-based employee management system through binary File Handling (In order to observe data security, we use binary
dangina [55]

Answer:

#include <fstream>

#include <iostream>

#define FILE_N "employee.dat"

using namespace std;

class Employee {

private :  

int  empID;

char  empName[100] ;

int  salary;

public  :

void readEmployeeDetails(){

 cout<<" PLEASE SUBMIT EMPLOYEE DETAILS"<<endl;

 cout<<"INPUT EMPLOYEE ID : " ;

 cin>>empID;

 cin.ignore(1);

 cout<<"ENTER EMPLOYEE NAME: ";

 cin.getline(empName,100);

 cout<<"ENTER EMPLOYEE SALARY : ";

 cin>>salary;

}

void increasesalary(){

 cout<<" Increment Salary"<<endl;

 cout<<"ENTER INCREMENT SALARY : ";

 int sal;

 cin>>sal;

 salary=salary + sal;

}

void displayEmployee(){

 cout<<"EMP ID: "<<empID<<endl

  <<"EMP NAME: "<<empName<<endl

  <<"SALARY: "<<salary<<endl;

}

};

int main(){

   int options;

   

LOOP:cout<<"Enter the Options:";

   cin>>options;

if(options == 1)

{

Employee emp;

emp.readEmployeeDetails();

fstream file;

file.open(FILE_N,ios::out|ios::binary);

if(!file){

 cout<<"There is an Error found while creating file...\n";

 return -1;

}

 

file.write((char*)&emp,sizeof(emp));

file.close();

cout<<"Date has been saved in the file.\n";

goto LOOP;

}

else if(options == 2)

{

Employee emp;    

fstream file;

file.open(FILE_N,ios::in|ios::binary);

if(!file){

 cout<<"There is an error while opening file...\n";

 return -1;

}

 

if(file.read((char*)&emp,sizeof(emp))){

  cout<<endl<<endl;

  cout<<"Data being discovered from the file..\n";

  emp.displayEmployee();

}

else{

 cout<<"There is an error while reading the file...\n";

 return -1;

}

goto LOOP;

}

else

{

  Employee emp;

emp.increasesalary();

fstream file;

file.open(FILE_N,ios::out|ios::binary);

if(!file){

 cout<<"Error found while creating file...\n";

 return -1;

}

 

file.write((char*)&emp,sizeof(emp));

file.close();

cout<<"Date saved inside the file.\n";

goto LOOP;

}

return 0;

}

Explanation:

The above program is in C++. It creates a class, assign it value, and then work on three option.

1. Press 1 to ADD AN EMPLOYEE.

2. Press 2 to DISPLAY FILE DATA.

3. Press 3 to INCREASE EMPLOYEE SALARY.

Rest is as shown in program.

8 0
4 years ago
Other questions:
  • Jack wants to store a large amount of data on his computer. He chooses to use a database for this purpose. What is a database? A
    8·1 answer
  • Which of the following Internet business models involves a merchant creating an online digital environment that enables people w
    11·1 answer
  • hey computor guys. is the MSI B250M GAMING PRO LGA 1151 Intel B250 HDMI SATA 6Gb/s USB 3.1 Micro ATX Motherboards - Intel compat
    8·1 answer
  • Write about the future of Reliability and Security in Software Engineering.
    13·1 answer
  • Which of the following occurs when the amount of money earned is greater than the
    5·1 answer
  • Compared with non-Internet users, today's online social networkers are likely to experience ________ relationships with their ex
    11·1 answer
  • Explain synchronized plug firing.
    14·1 answer
  • What necessarily happens when a photographer chooses to give either the aperture or the shutter speed priority?
    10·1 answer
  • Computers are not automatic they need human to operate.(true or false)​
    6·2 answers
  • How to view average for an assignment in gradebook in canvas.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!