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
exis [7]
3 years ago
5

Two friends are eating dinner at a restaurant. The bill comes in the amount of 47.28 dollars. The friends decide to split the bi

ll evenly between them, after adding 15% tip for the service. Calculate the tip, the total amount to pay, and each friend's share, then output a message saying "Each person needs to pay: " followed by the resulting number.
Computers and Technology
1 answer:
Daniel [21]3 years ago
4 0

Answer:

bill = 47.28

tip = bill * 0.15

total_pay = bill + tip

each_share = total_pay / 2

print("Each person needs to pay: " + str(each_share))

Explanation:

*The code is in Python.

Set the bill

Calculate the tip, multiply the bill by 0.15

Calculate the total_pay, add bill and tip

Calculate each friend's share, divide the total_pay by 2. Then, print it in required format.

You might be interested in
Someone learn me more American Sign Language (ASL). Please.
sveticcg [70]

Answer:

Ok I will

Explanation:

3 0
3 years ago
Which of the following statement is correct ? A . potential difference is measured by ammeter . B . The unit of potential differ
lina2011 [118]

Answer:

C.Battery is a source of potential difference in a circuit.

Explanation:

A battery is a source of electrons and positive ions which sets one of it's terminal (cathode) at negative potential and the other (anode) at positive potential. Hence a battery is a source of electricity(electrons) which sets a potential difference across the battery terminals.

4 0
3 years ago
What does enterprise operating system mean?
Alla [95]
It means the operating system used in enterprise.
When a corporation needs 100 computers to have OS, it has to order enterprise OS packages from M$.
7 0
4 years ago
Which of the following events happened first?
horrorfan [7]

Answer:

D. ARPANET was developed

Explanation:

ARPANET is an acronym for Advanced Research Projects Agency Network and it was established in 1969 by the Advanced Research Projects Agency (ARPA) of the United States Department of Defense.

ARPANET was the first wide area packet switching network for transmitting electronic data and communications between computers on a single network with a distribution functionality. The TCP/IP protocol was first implemented on the Advanced Research Projects Agency Network (ARPANET), as well as some other standard protocols such as the NCP and the 1822 protocol.

The development of ARPANET happened first in the evolution of the internet.

E-mail is an acronym for electronic mail and it was invented by Ray Tomlinson in 1971; World Wide Web was created by Tim Berners-Lee in 1990; Web 2.0 evolved in 1999.

6 0
3 years ago
You will write a program that reads a binary file that contains records of creatures. Each record can be stored in a Creature st
yuradex [85]

Answer:

Explanation:

main.cpp file

/******************************

Name

Date

PA1_Starter.cpp

Description

********************************/

// Headers

#include <iostream>

#include <cstdlib>

#include <string>

#include <vector>

#include <fstream>

#include <algorithm>

using namespace std;

// Global variables

const int CREATURE_NAME_SIZE = 30; // Max length of a creature name

const int CREATURE_TYPE_SIZE = 26; // Max length of a creature type

const string FILENAME = "creatures.dat"; // Name of file that contains the data

// struct used to create records in file

struct Creature

{

char name[CREATURE_NAME_SIZE]; // Name of the creature

char creatureType[CREATURE_TYPE_SIZE]; // Type of creature

int hp; // Hit points for creature

int armor; // Armor class for creature

int speed; // Speed of creature

};

// This function returns true if the name of the left creature is less than the name of the right creature

// Use this function when running the sort function

bool sortByName(const Creature &lhs, const Creature &rhs)

{

string name1(lhs.name), name2(rhs.name);

return name1 < name2;

}

// Function declarations

// You will need to code the definitions for each of these functions

int getCreatureNumber(int numCreatures);

void displayCreature(fstream& file, int num);

void displaySorted(fstream& file);

int main()

{

char choice; // choice made by user for menu

fstream creatureFile; // file stream for input file

int numCreatures; // the number of creatures saved to the file

 

// Open the creatureFile for input and binary (one statement of code)

 

// Get the number of creatures in the file (two statements of code)

// The number of creatures should be assigned to numCreatures

do

{

cout << "Menu" << endl;

cout << "1. Display a specific creature\n";

cout << "2. Display all creatures sorted by name\n";

cout << "3. Quit\n";

cout << "Enter your choice (1, 2, 3): ";

cin >> choice;

while (cin.get() != '\n');

switch (choice)

{

case '1': // Display a specific creature

displayCreature(creatureFile, getCreatureNumber(numCreatures));

break;

case '2': // Display all the creatures in order

displaySorted(creatureFile);

break;

case '3': // Quit

break;

default:

cout << "Invalid option.\n";

break;

}

if (choice != '3')

{

system("PAUSE");

system("CLS");

}

} while (choice != '3');

creatureFile.close();

 

 

// Make sure we place the end message on a new line

cout << endl;

// The following is system dependent. It will only work on Windows

system("PAUSE");

/*

// A non-system dependent method is below

cout << "Press any key to continue";

cin.get();

*/

return 0;

}

/*******************************************************************

getCreatureNumber gets and returns the record number from the file that the user would like to be displayed

PARAM: numCreatures should be the value of the total number of records (creatures) in the file

PRE: numCreatures contains a value that is equal to the number of records in the file

POST: A value between 1 and numCreatures is returned as selected by the user

NOTE: Do not allow a value less than 1 or greater than numCreatures to be returned

********************************************************************/

int getCreatureNumber(int numCreatures)

{

 

}

/*******************************************************************

displayCreature displays record number num from file

PARAM: file is a fstream that should be open for input and binary

num contains the record number that is to be read in file

PRE: file is a fstream that is open for input and binary

num is a value between 1 and the number of records in file

POST: The record number num is displayed to the monitor

********************************************************************/

void displayCreature(fstream& file, int num)

{

 

}

/*******************************************************************

displaySorted should read file into a vector. It should then sort the vector by

the name of the creature. Last it should display the vector

PARAM: file is a fstream that should be open for input and binary

PRE: file is open for input and binary

POST: Each record is displayed sorted by the name of the creature

********************************************************************/

void displaySorted(fstream& file)

{

 

}

5 0
3 years ago
Other questions:
  • Use the following business rules to assign name to the tables on the ERD: Note: These rules are in the context of a small retail
    7·1 answer
  • Security testing attempts to verify that protection mechanisms built into a system protect it from improper penetration.
    9·1 answer
  • A tripod head can move vertically or horizontally. What term describes these movements?
    15·2 answers
  • The user can set their own computer hostname and username. Which stage of the hardware lifecycle does this scenario belong to?
    6·1 answer
  • What is information associated with a document to help describe that document called?
    12·1 answer
  • A telephone repair technician uses a meter to measure voltage on a phone line. This meter is an example of _____.
    10·2 answers
  • The base 10 number 18 is equal to which base 16 number?<br><br> 10<br><br> 12<br><br> 14<br><br> 16
    11·1 answer
  • Type of file containing instructions that tell your computer how to perform ___
    9·1 answer
  • Heya! I’m quite lonely, so here are some points. I want to play some mc with others but the only version I’m able to play is edu
    11·2 answers
  • ______ controls are information security safeguards that focus on the application of modern technologies, systems, and processes
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!