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
babunello [35]
3 years ago
11

Task

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

Answer:

Please see the full code in explanation

Explanation:

#This is a console program

def bill_calculator():

print("Enter the Total value of the bill:\n")

bill_total = float(input())

print("Enter total number of dinners:\n")

total_dinner = int(input())

bill_per_person = bill_total / total_dinner

result = ("Bill total: {} \n"

"Total dinners: {} \n"

"Bill per person: {} ").format(bill_total,total_dinner, bill_per_person)

print(result)

if __name__ == '__main__':

bill_calculator()

You might be interested in
HTTP is the protocol that governs communications between web servers and web clients (i.e. browsers). Part of the protocol inclu
N76 [4]

Answer and Explanation

In C programming, switch statements allows  a variable to be tested for equality against a list of values. The switch statements works by evaluating the expression and then executing all statements that follow the matching case label.

switch()status

{

case 200:

cout<<"OK(fulfilled)",

break;

case 403:

cout<<"forbidden";

break;

case 404:

cout<<not found";

break;

case 500:

cout<<"server error";

break;

}

6 0
3 years ago
If you were looking for a record in a very large database and you knew the ID number, which of the following would be the most d
dezoksy [38]

Answer:

By the record ID

Explanation:

5 0
4 years ago
Because an AVL tree is a binary search tree, the search algorithm for an AVL tree is the same as the search algorithm for a bina
Nikolay [14]

Answer:

True, Yes the search algorithm for AVL tree and the binary search tree are same.

Because in both trees, of a certain a node, the smaller elements reside in the left sub-tree and the larger elements reside in the right sub-tree.

Explanation:

So while searching an element in the AVL tree we start the search from the root node.

We compare the element to be searched with the root node.

if (element < root node), then move in left and compare with it's left child.

else move in right and compare with it's right child.

Similarly in next phase move accordingly as in the binary search tree.

8 0
3 years ago
Progressively enhancing a web page for different viewing contexts (such as smartphones and tablets) through the use of coding te
daser333 [38]

Answer:

responsive web design

Explanation:

Responsive web design is the way web designers make web page scale into different screen sizes, layouts and orientations and this is usually achieved by the combination of one or more of the following : coding techniques, flexible images, CSS libraries and CSS media queries etc.

8 0
4 years ago
Create a function named PrintStudents, which takes a string input filename and an integer minimum score value and a string outpu
givi [52]

Answer:

The code is implemented below on C++

Explanation:

#include <iostream>

#include <fstream>

#include <string>

using namespace std;

// function declaration

int PrintStudents(string inputFile, int min_score,string outputFile);

int split(string s,char sep, string words[], int max_words );

int main() {

// test the function

              int n = PrintStudents("students.txt",80,"outStudents.txt");

              if(n != -1)

                             cout<<"\n No. of students : "<<n<<endl;

              else

                             cout<<"\n No such file exists";

              return 0;

}

// function to write the details of the students whose score >= min_score

// inputs : input file, minimum score and output file

// output : number of records read, -1 if error

int PrintStudents(string inputFile, int min_score,string outputFile)

{              // open the input file

              ifstream fin(inputFile.c_str());

              // if input file can be opened

              if(fin.is_open())

              {              // open the output file for writing

                             ofstream fout(outputFile.c_str());

                             int n=0,score;

                             string line;

                             string words[3];

                             // read till the end of file

                             while(!fin.eof())

                             {

                                            getline(fin,line);

                                            n++;

                                            // get the score from the record read

                                            score = split(line,',',words,3);

                                            // check if score>=min_score, then write to output file

                                            if(score >= min_score)

                                                           fout<<words[0]<<", "<<words[2]<<"\n";

                                            if(fin.eof())

                                                           break;

                             }

                             // close the files

                             fin.close();

                             fout.close();

                             return n; // return the number of records read

              }else

              {

                             fin.close();

                             return -1; // file not found

              }

}

// function to split a string on a given separator and return the score

// inputs : string , word separator, array of words and max_words

// output is the score

int split(string s,char sep, string words[], int max_words )

{

              int index=0,i=0 ;

              //loop to extract the words from the line

              while(s.find(sep,index+1)!= -1){

                             words[i] = s.substr(index,s.find(sep,index+1)-index);

                             i++;

                             index = s.find(sep,index+1)+2;

              }

              words[i] = s.substr(index); // extract the last word

              // convert to integer and return the score

              return(stoi(words[1]));

}

4 0
3 years ago
Other questions:
  • Jim has entered the age of each of his classmates in cells A1 through A65 of a spreadsheet. Which function should Jim use to fin
    11·2 answers
  • PriQueue inherits from Queue. In the implementation of the getMax() method in the PriQueue class, we need to read and write the
    5·1 answer
  • Need Help !!! Please
    8·1 answer
  • While working on a group project, you notice something does not look right in the presentation. You call a meeting with your tea
    14·2 answers
  • Write a program that will take a user-input number and then display all of the whole # factors for that number. For example, if
    13·1 answer
  • How do you view a presentation as your audience would see it?
    14·2 answers
  • When Russ opened a website on his browser, he saw an error that the site was not compatible with the browser version he was runn
    9·1 answer
  • Energía de movimiento de los átomos o moléculas
    11·1 answer
  • A large number of genetic codes are stored as binary values in a list. Which one of the following conditions must be true in ord
    5·2 answers
  • Name at least 3 different portable computer devices that can be purchased
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!