answer.
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
Black_prince [1.1K]
2 years ago
13

Write an application that allows a user to enter the names and birthdates of up to 10 friends. Continue to prompt the user for n

ames and birthdates until the user enters the sentinel value ZZZ for a name or has entered 10 names, whichever comes first. When the user is finished entering names, produce a count of how many names were entered, and then display the names. In a loop, continuously ask the user to type one of the names and display the corresponding birthdate or "Sorry, no entry for name" if the name has not been previously entered. The loop continues until the user enters ZZZ for a name.
Computers and Technology
1 answer:
baherus [9]2 years ago
7 0

Answer:

<em>Written in Python</em>

names= []

birthday = []

name = input("Name: ")

bday = input("Birthday: ")

for i in range(1,11):

    names.append(name)

    birthday.append(bday)

    if name == "ZZZ":

         break;

    else:

         name = input("Name: ")

         bday = input("Birthday: ")

print("Length: ", end='')

print(len(names))

checknm = input("Check Name: ")

while checknm != "ZZZ":

    if checknm in names:

         ind = names.index(checknm)

         print(birthday[ind])

    else:

         print("Sorry, no entry for name")

    checknm = input("Check Name: ")

Explanation:

<em>The program is written in Python and I've added the full source code as an attachment where I used comments to explain difficult lines</em>

<em />

Download txt
You might be interested in
A credit card company receives numerous phone calls throughout the day from customers reporting fraud and billing disputes. Most
Veronika [31]

Answer:

3.59 minutes

Explanation:

We solve this question using z score formula

Using Excel

Z-SCORE= (DataPoint-AVERAGE(DataSet))/STDEV(DataSet)

IN EXCEL,

AVERAGE, an excel function that calculates the Average of data set

STDEV.S: calculates the standard deviation while treating the data as a ‘sample’ of a population.

STDEV.P: This function calculates the standard deviation while treating the data as the entire population.

Z score formula = x - μ/σ

x = ?? μ = 2.5 minutes σ = 0.5 minutes

We are asked : If 1.5% of the callers are put on hold for longer than x minutes, what is the value of x?

Hence, Longer than = Greater than =

100 - 1.5%

= 100 - 0.015

= 0.985 ( 98.5%)

Using Excel we calculate = z score for 98.5 percentile

= 2.1701

Z score = x - μ/σ

2.1701 = x - 2.5/0.5

2.1701 × 0.5 = x - 2.5

1.08505 = x - 2.5

x = 1.08505 + 2.5

x = 3.58505

Approximately to 2 decimal places = 3.59 minutes

Therefore, 1.5% of the callers are put on hold for longer than 3.59 minutes.

8 0
2 years ago
7. Test Average and Grade Write a program that asks the user to enter five test scores. The program should display a letter grad
Alenkasestr [34]

Answer:

The code solution is written in Java.

  1. import java.util.Scanner;
  2. public class TestScore {
  3.    public static void main(String[] args) {
  4.        Scanner input = new Scanner(System.in);
  5.        System.out.print("Please enter first score: ");
  6.        double firstScore = input.nextDouble();
  7.        System.out.println("Grade: " + determineGrade(firstScore));
  8.        System.out.print("Please enter second score: ");
  9.        double secondScore = input.nextDouble();
  10.        System.out.println("Grade: " + determineGrade(secondScore));
  11.        System.out.print("Please enter third score: ");
  12.        double thirdScore = input.nextDouble();
  13.        System.out.println("Grade: " + determineGrade(thirdScore));
  14.        System.out.print("Please enter fourth score: ");
  15.        double fourthScore = input.nextDouble();
  16.        System.out.println("Grade: " + determineGrade(fourthScore));
  17.        System.out.print("Please enter fifth score: ");
  18.        double fifthScore = input.nextDouble();
  19.        System.out.println("Grade: " + determineGrade(fifthScore));
  20.        System.out.println("Average score: " + calcAverage(firstScore, secondScore, thirdScore, fourthScore, fifthScore));
  21.    }
  22.    public static double calcAverage(double score1, double score2, double score3, double score4, double score5){
  23.        double average = (score1 + score2 + score3 + score4 + score5) / 5;
  24.        return average;
  25.    }
  26.    public static String determineGrade(double score){
  27.        if(score >= 90){
  28.            return "A";
  29.        }
  30.        else if(score >= 80 ){
  31.            return "B";
  32.        }
  33.        else if(score >=70){
  34.            return "C";
  35.        }
  36.        else if(score >=60){
  37.            return "D";
  38.        }
  39.        else{
  40.            return "F";
  41.        }
  42.    }
  43. }

Explanation:

Firstly, create the method, <em>calcAverage()</em>, that takes five test scores. Within the method, calculate the average and return it as output. (Line 33 - 36)

Next, create another method, <em>determineGrade()</em>, which takes only one score and return the grade based on the range of the  score. (Line 38 -54)

Once the two required methods are created, we are ready to prompt use for input five test scores using Java Scanner class. To use get user input, create a Scanner object (Line 7). Next, use getDouble() method to get an input score and assign it to variables firstScore, secondScore, thirdScore, fourthScore & fifthScore, respectively. Once a score input by user, call determineGrade() method by passing the input score as argument and immediately print out the return grade. (Line  9 - 27)

At last, call calcAverage() method by passing the first test score variables as argument and print out the returned average value. (Line 29).

5 0
2 years ago
Write a function that computes the average and standard deviation of four scores. The standard deviation is defined to be the sq
ZanzabumX [31]

Answer:

#include<iostream>

#include<cmath>

using namespace std;

double calAvg(double s1, double s2,double s3, double s4);

double calStandardDeviation(double s1, double s2,double s3, double s4,double average,int n);

void main()

{

 double s1,s2,s3,s4;

double avg,StandardDeviation;

char option;

   do

{

 cout<<"Enter s1:";

 cin>>s1;

 cout<<"Enter s2:";

 cin>>s2;

 cout<<"Enter s3:";

 cin>>s3;

        cout<<"Enter s4:";

 cin>>s4;

 avg=calcAvg(s1,s2,s3,s4);

        sdeviation=calcStandardDeviation(s1,s2,s3,s4,avg,4);

 cout<<"Standard deviation:"<<sdeviation<<endl;

 cout<<"Do you want to continue then press y:";

         cin>>option;

}

       while (option='y');

}

double Average(double s1, double s2,double s3, double s4)

{

return (s1+s2+s3+s4)/4;

}

double calcStandardDeviation(double s1, double s2,double s3, double s4, double mean,int n)

{

double sd;

sd=(pow((s1-mean),2)+pow((s2-mean),2)+

                     pow((s3-mean),2)+pow((s4-mean),2))/n;

sd=sqrt(sd);

return sd;

}

7 0
2 years ago
Determine the number of bytes necessary to store an uncompressed binary image of size 4000 × 3000 pixels.
miss Akunina [59]

Answer:

12,000,000 bytes.

Explanation:

If we want to store an uncompressed binary image, assuming that we will use 256 different levels to represent all tones in a monochromatic image, each pixel will be stored as an 8-bit sample, i.e. one byte per pixel.

The complete image will have 4000 pixels wide by 3000 pixels height, so an entire image will need 3000*4000= 12,000,000 pixels.

As we will use 8 bits= 1 Byte per pixel, we will need to store 12,000, 000 bytes for a complete uncompressed monochromatic (white & black) image.

5 0
2 years ago
Picture an expensive item you’d LOVE to own. What would make you happier: Buying it NOW using credit/taking out a loan? Buying i
dezoksy [38]

Answer:Buying Later

Explanation: Buying later would be the better choice because not only will you feel reawrded for working hard to get what you want but you also will not have to o throught the hassle of getting a loan. It may also be cheeper becuae many loans charge interest.

5 0
2 years ago
Other questions:
  • Corey set up his presentation for delivery to his team. The information he had to convey was critical to their job performance.
    6·3 answers
  • What critical issue in symmetric and asymmetric encryption is resolved by using a hybrid method like diffie-hellman?
    5·2 answers
  • ​identify a text-level element used to mark generic run of text within the document.
    15·1 answer
  • Which term describes a process by which malicious code can enter from a non-secure network, and make a hairpin, or sharp turn, a
    6·1 answer
  • Explain how buyers and sellers factor into setting the stock price for a company’s shares.
    13·1 answer
  • The UML models operations by listing the operation name preceded by an access modifier. A(n) ________ indicates a public operati
    7·2 answers
  • CodeHS Python Rainforest Exercise 5.4.7: Categories
    12·1 answer
  • Dawn needs to insert a macro into a Word document. Where can she find the Insert Macro dialog box?
    11·1 answer
  • What does NOT match with Agile Manifesto?
    9·1 answer
  • Doug grew up on a large farm in southwest Wisconsin. As a college graduation gift, Doug’s father gave him several hundred acres
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!