Questions
A customer comes into a grocery store and buys 8 items.   Write a PYTHON program that...

A customer comes into a grocery store and buys 8 items.   Write a PYTHON program that prompts the user for the name of the item AND the price of each item, and then simply displays whatever the user typed in on the screen nicely formatted.

In: Computer Science

In this exercise, you will complete the Restaurant Tip application from Chapter 2’s Focus on the...

In this exercise, you will complete the Restaurant Tip application from Chapter 2’s Focus on the Concepts lesson. The application’s Planning Chart is shown in Figure 3-34.

  1. Use either a flowchart or pseudocode to plan the btnCalc_Click procedure, which should calculate and display a server’s tip.
  2. Open the Tip Solution.sln file contained in the VB2017\Chap03\Tip Solution folder. Enter the three Option statements in the Code Editor window. Use the comments as a guide when coding the btnCalc_Click procedure. Be sure to use variables in your code. Display the tip with a dollar sign and two decimal places. Save the solution and then start and test the application. (If the restaurant bill and tip percentage are 56
  3. and 20, respectively, the tip is $11.20.)
  4. Now professionalize your interface by coding each text box’s TextChanged and Enter event procedures. Save the solution and then start and test the application.

In: Computer Science

using C++ 8. Star Search A particular talent competition has 5 judges, each of whom awards...

using C++

8. Star Search
A particular talent competition has 5 judges, each of whom awards a score between 0 and
10 to each performer. Fractional scores, such as 8.3, are allowed. A performer’s final score
is determined by dropping the highest and lowest score received, then averaging the 3
remaining scores. Write a program that uses these rules to calculate and display a
contestant’s score. It should include the following functions:
• void getJudgeData() should ask the user for a judge’s score, store it in a reference
parameter variable, and validate it. If the user does not enter valid value, keep displaying error message shown in test cases until the user types in the valid value. This function should be called by main once for each
of the 5 judges.
• double calcScore() should calculate and return the average of the 3 scores that
remain after dropping the highest and lowest scores the performer received. This
function should be called just once by main and should be passed the 5 scores.
Two additional functions, described below, should be called by calcScore, which uses the
returned information to determine which of the scores to drop.
• double findLowest() should find and return the lowest of the 5 scores passed to it.
• double findHighest() should find and return the highest of the 5 scores passed to it.

test case

Judge #1 - Please enter a score between 0.0 and 10.0 : 5

Judge #2 - Please enter a score between 0.0 and 10.0 : 6.5

Judge #3 - Please enter a score between 0.0 and 10.0 : 9.5

Judge #4 - Please enter a score between 0.0 and 10.0 : 5.5

Judge #5 - Please enter a score between 0.0 and 10.0 : 6

Final Score : 6

In: Computer Science

1-If attackers are able to get their hands on a password file, where all the passwords...

1-If attackers are able to get their hands on a password file, where all the passwords are hashed and salted, what would be their best approach to obtain at least one of these password?

Here an example of the first two lines of a generic password file:

HASH (SHA-256) SALT
1138275656b8e5d8f48a98c3c92df27e6fbfe24a750e72930c220a8e2caba935 535788591
ee65ef498fb368a2dfd38b40f0ee75c05963cd9da6e5f014118c7d9747fcc97f4 778035290

2-Play-Doh (Links to an external site.) has been used to get access to systems that used fingerprinting as access control (yup, and it worked 90% of the time with any scanner...)

Which of the following methods would be effective to avoid this kind of attack? Select all that apply.

Group of answer choices

a)The fingerprinting sensor should be able to recognize blood vessels and compute pressure and other kind of analysis

b)The fingerprinting sensor should be able to liquify the Play-Doh™ (around 1000 °F)

c)The fingerprinting sensor should actually be fake, letting the attackers waste their time playing with Play-Doh

d)The fingerprinting sensor should check for humidity levels of the finger

e)The fingerprinting sensor should emit a light to check if the pupil reacts

3-Suppose you receive a digital certificate that contains M and [h(M)]CA , where M = (Alice, Alice's public key) and "CA" is a Certificate Authority.

How do you verify the Signature?

Remember that:

[X]Bob indicates encryption via Bob's private key to X (signature)

h(X) indicates the cryptographic hash function applied to X

Group of answer choices

a)You decrypt the encrypted message using the CA's public key, then you compute the hash of M, finally you compare the two hashes

b)You decrypt the encrypted message using the CA's private key, then you compute the hash of M, finally you compare the two hashes

c)You decrypt the encrypted message using the CA's private key, then you compute the hash of [h(M)]CA, finally you compare the two hashes

d)You decrypt the encrypted message using the CA's public key, then you compute the hash of [h(M)]CA, finally you compare the two hashes

In: Computer Science

for Python 3 Write a python program that Creates a list that has these values in...

for Python 3

Write a python program that
  Creates a list that has these values in this order,
        'Python', 'JavaScript', and 'PHP'

 Define a displayMyClasses function that sorts the list
        and then displays each item on the list, one per line,
        in sorted order.  Also, number the displayed list as
        shown in the "Running a Sample Program" shown below.
        
Define a guessNext function that selects a random
        element from the list and returns it to the call of the function.

When the program begins, the main function should display the "Assignment 5" 
        title as the first line and then call the displayMyClasses function to  
        display the current contents of the list.
        
Next, prompt the user to enter an "A" to add a new class to the list
        or enter an "R" to remove a class from the list.
        
If the user enters a blank, exit the loop.
        
If the user enters an "A", then prompt them to enter the name of the class
        they want to add to the end of the list and, after they answer, add the
        class to the end of the list.

If the user enters an "R", then prompt them to enter the name of the class
        they want to remove from the list and, after they answer, remove the
        class from the list.
        
If the user has not entered an "A" or and "R" display a message
        that says "You must choose an 'A' to Add or an 'R' to Remove a class"
        and start the code back at the top of this #5 step so that they
        get re-prompted for the correct information.

Once the loop is exited, call the displayMyClasses to display 
        the current contents of the list.
        
Now call the guessNext function and receive the random
        class value returned.
        
Display "The next class you should teach is: (the random class)"
        


Below is a example of how the program should run
the program should run in a similar
manner no matter what names and age are entered.


Assignment 5

List of Classes I Teach: 

1. JavaScript
2. PHP
3. Python

Do you need to Add or Remove a class? (A/R)A

Enter the name of the class you wish to add: HTML

Do you need to Add or Remove a class? (A/R)R

Enter the name of the class you wish to remove: PHP

Do you need to Add or Remove a class? (A/R)A

Enter the name of the class you wish to add: PHP with MySQL

Do you need to Add or Remove a class? (A/R)d

You must choose an 'A' to Add or an 'R' to Remove a class

Do you need to Add or Remove a class? (A/R)

List of Classes I Teach: 
1. HTML
2. JavaScript
3. PHP with MySQL
4. Python

The next class you should teach is: JavaScript

here is what i have so far and i am stuck....

mylist = ["Python", "JavaScript", "PHP"]

def main():
    print("Assignment 5\n")


def displayMyClasses():
    print("List of Classes I Teach: ")

    print(mylist)

    mylist.sort()
  
    for item in mylist:
        print(item)


def guessNext():


if __name__ == "__main__":
    main()
  

In: Computer Science

A java program with classes and methods to manage employment. Program should be able to store/add...

A java program with classes and methods to manage employment. Program should be able to store/add employees, calculate payroll, display or schedule shifts.

All classes should have at least a null constructor and copy constructor. Other constructors are up to your discretion. Include all necessary accessors and modifiers.

To test the classes, create a container class with simply a main() method. The container class will have attributes that are class objects of each of the classes you create. The main() method will create the class objects, perform duties and produce appropriate output.

In: Computer Science

Using the below program as a starting point C++ Program - Arrays- Chapter 9     Include...

Using the below program as a starting point

C++ Program - Arrays- Chapter 9

    Include the following header files in your program:     string, iomanip, iostream
Suggestion: code steps 1 thru 4 then test then add requirement 5, then test, then add 6, then test etc. Add comments to display assignment //step 1., //step 2. etc. This program is to have no programer created functions. Just do everything in main and make sure you comment each step so I can grade more easily.
C++ Program Pointers

Before starting on this project you should make sure points 1 to 15 are working properly from Chapter 7 Arrays project.
This program is to have no programer created functions. Just do everything in main and make sure you comment each step so I can grade more easily.
C++ Program Extension - This will be graded as a separate program but will add the following to Chapter 7 Arrays project. Don't forget to include comments with the corresponding number.

Extend the Array project to include:
16. Define a pointer to a double, pdArray.
17. Assign the pointer, pdArray, to contain the address of the double array, dArr:
18. Use the array name, dArr, to print out the array elements with subscript notation, [ ]. All on 1 line a space between each.
19. Use the pointer to print out the array elements with pointer notation while not changing the pointer itself. Use a for loop. *( pdArray + Cnt1) would be an example. All on 1 line a space between each.
20. Use the pointer to print out the array elements with pointer notation but change the pointer to point to the actual array element rather than the method in 18. All on 1 line.
*pdArray would do this if the loop has the following post loop operation:   pdArray++
21. Use the array name for the double array and pointer notation to print the entire array, all on one line.
22. Using a different pointer, piArray, allocate enough memory for 100 int's and assign the address to the pointer.
23. In a for loop assign every item in the array to be a random number from 1 to 49 ( hint: rand() % 6 + 1 gives random numbers from 1 to 6 )
24. Using cout print the first 10 items in the array, all on 1 line.

USE THIS PROGRAM AS STARTING POINT

//Christopher Cupani
//Sept 22, 2019
//Online class
//Chapter 7
#include <iostream>
#include <istream>
#include <string>
#include <iomanip>
#include <cstring>
using namespace std;

int main()
{
   //The variables are declare
   double dArr[5];
   double lArr[7] = { 100000, 134567, 123456, 9, -234567, -1, 123489 };
   int iArr[3][5];
   char sName[30] = { 'C','h','r','i','s' };
   //define variables cnt1 and cnt2 (short data types)
   short cnt1, cnt2;
   long double total = 0;
   //define one long variable and it call highest
   long highest;
   // 4
   int i;
   //Create a loop to put a random number into each of the elements
   //of the array of double.
   srand(time(0));
   for (i = 0; i < 5; i++) {
       double f = (double)rand() / RAND_MAX;
       dArr[i] = 1 + f * (49);
   }
   //Create a for loop to display all of the values in dArr.
   for (i = 0; i < 5; i++) {
       cout << dArr[i] << " ";
   }
   cout << endl;
   // loop to add up the array of double, dArr, into the
   //variable total
   for (i = 0; i < 5; i++) {
       total += dArr[i];
   }
   //display the total
   cout << "Total of double array is " << total << endl;
   //display the average
   cout << "Average of double array is " << total / 5 << endl;
   // Create a for loop that was like example in the instructions
   //to the following for the long array, lArr.
   for (cnt1 = 1, highest = lArr[0]; cnt1 < 7; cnt1++)
   {
       //logic to compare each array element, starting with lArr[1], with highest
       //replace highest if the value in lArr[cnt] is higher than the value in variable highest
       if (highest < lArr[cnt1])
           highest = lArr[cnt1];
   }
   //display the highes value
   cout << "Highest is " << highest << endl;
   //generate random number in 2d array between 1 to 53
   for (cnt1 = 0; cnt1 < 3; cnt1++)
   {
       for (cnt2 = 0; cnt2 < 5; cnt2++) {
           iArr[cnt1][cnt2] = rand() % (53) + 1;
       }
   }
   cout << endl;
   //Display the 2 d array with setw(3)
   cout << "iArr is " << endl;
   for (cnt1 = 0; cnt1 < 3; cnt1++)
   {
       for (cnt2 = 0; cnt2 < 5; cnt2++) {
           cout << setw(3) << iArr[cnt1][cnt2];
       }
       cout << endl;
   }
   cout << endl;
   //Display 2d array iArry column wise
   cout << "iArry print in column wise " << endl;
   for (cnt1 = 0; cnt1 < 5; cnt1++)
   {
       for (cnt2 = 0; cnt2 < 3; cnt2++) {
           cout << setw(3) << iArr[cnt2][cnt1];
       }
       cout << endl;
   }
   cout << endl;
   //Use cin.getline( ...... ) to add another name into variable sName.
   cout << "Enter the name " << endl;
   cin.getline(sName, 30);
   //Display the name
   cout << sName << endl;
   cnt1 = 0;
   //Display the ascii value of each character in the char array,
   //1 per line. Use a while loop to look for the '\0' as a signal to end.
   while (sName[cnt1] != '\0') {
       cout << sName[cnt1] << " Ascci is " << int(sName[cnt1]) << endl;
       cnt1++;
   }
   //Entering Albert Einstein to sName array and
   //using strcpy_s function.
   strcpy_s(sName, "Albert Einstein");
   cout << sName << endl;
   //Display the ascii of 12th character
   cout << "12th character ascii value is " << int(sName[12]);

   return 0;
}

In: Computer Science

Develop a program to maintain a Linked List of homework assignments name and due date. When...

Develop a program to maintain a Linked List of homework assignments name and due date. When an assignment is assigned, add it to the list, and when it is completed, remove it. You should keep track of the due date. Your program should provide the following services each contained within its own method:

  • Add a new assignment.
  • Remove an assignment.
  • Provide a list of the assignments in the order they were assigned.
  • Find the assignment(s) with the earliest due date

-The commands are input from the user keyboard as well as the Assignment Names and the Assignment Due Dates. All entered by the user.

-Coded with comments

In: Computer Science

How do I convert a character column into date in R/Sql? The data is in the...

How do I convert a character column into date in R/Sql? The data is in the format "01 02:52:12" i.e <day> <hr>:<min>:<sec>
I want to convert this into Date time format.

In: Computer Science

Write a C/C++ program which reads in a list of process names and integer times from...

Write a C/C++ program which reads in a list of process names and integer times from stdin/cin and simulates round-robin CPU scheduling on the list. The input is a list of lines each consisting of a process name and an integer time, e.g. ProcessA 4 ProcessB 10 Read the list until end of transmission (^d). You should read the list and represent it in a linked list data structure. You should use the alarm system call to schedule a timer interrupt every 3 seconds. The interrupt handler should pick the next process from the process list, write a message saying how much time it has left to execute, i.e. ProcessA 4 Then update its time left to execute by subtracting 3 seconds and return it to the end of the queue. If the process had no time left to execute, you should write a message saying this i.e. ProcessA Finished And delete this process from the linked list. If there are no processes left to execute, write a message saying No processes left And terminate your program.

In: Computer Science

Integer Pointers Program and Analysis Demonstrate an understanding of basic C++ programming concepts by completing the...

Integer Pointers Program and Analysis

Demonstrate an understanding of basic C++ programming concepts by completing the following:

  • Program: Create a C++ program that asks the user to enter three integer values as input. Store the values into three different variables. For each variable, create three integer pointers that point to each value. Display the contents of the variables and pointers. In your program, be sure to use the new operator and delete operators to management memory.
  • Program Analysis: Given your program implementation, discuss and identify the possible security vulnerabilities that may exist. If present, discuss solutions to minimize the vulnerabilities. Discuss and identify possible problems that can result in errors when using integer pointers. Your analysis should be 1-2 pages in length.

In: Computer Science

Rewrite the attached code program using read, write, open and close (System I/O functions) instead of...

Rewrite the attached code program using read, write, open and close (System I/O functions) instead of the standard I/O functions. Also please write comments explaining each line of code clearly and concisely please.

#include
#include

int main(int argc, char *argv[])
{ FILE *fd;
   char c;

   if(argc==1)
   fd=stdin;
   else
        if((fd = fopen(argv[1], "r"))==NULL){
       fprintf(stderr, "Error opening %s, exiting\n", argv[1]);            exit(0);
   }

   while( (c=getc(fd)) != EOF)
   putc(c, stdout);

   exit(0);
}

In: Computer Science

this is my code in python I am trying to open a file and then print...

this is my code in python I am trying to open a file and then print the contents on my console but when i run it nothing prints in the console

def file_to_dictionary(rosterFile):

myDictionary={}

  

with open(rosterFile,'r') as f:

for line in f:

myDictionary.append(line.strip())

print(myDictionary)

  

  

  

  

return myDictionary

  

file_to_dictionary((f"../data/Roster.txt"))

  

  

In: Computer Science

Use a JavaScript program to: Stimulate a coin tossing environment using random functions and using a...

Use a JavaScript program to:

Stimulate a coin tossing environment using random functions and using a for loop - toss the coin 100 times and print the number of heads and tails.

A detailed answer would be appreciated, I would like to learn from it rather than just know the answer. Thanks in advance!

In: Computer Science

Change the format of the given code to two columns, add a sub title and an...

Change the format of the given code to two columns, add a sub title and an author name and increase the color and thickness of the column-rule. Add an image and float the text around the image.

<!DOCTYPE html>
<!-- Fig. 5.17: multicolumns.html -->
<!-- Multicolumn text in CSS3. -->
<html>
<head>
<meta charset = "utf-8"›
<title>Multicolumns</title>
<style type = "text/css"›
p
{ margin:0.9em Oem; }
.multicolumns
{
/* setting the number of columns to 3 */
-webkit-column-count: 3;
-moz-column-count: 3;
-o-column-count: 3;
column-count: 3;
/ *setting the space between columns to 30px */
-webkit-column-gap: 30px;
-moz-column-gap: 30px;
-o-column-gap: 30px;
column-gap: 30px;
/ *adding a 1px black line between each column */
-webkit-column-rule: 1px outset black;
-moz-column-rule: 1px outset black;
-o-column-rule: 1px outset black;
column-rule: 1px outset black;
}
</style>
</head>
<body>
<header>
<h1>Computers, Hardware and Software<h1/>
</header>
<div class = "multicolumns">
<p>A computer is a device that can perform computations and make logical decisions phenomenally faster than human beings can. Many of today's personal computers can perform billions of calculations in one second&mdash;more than a human can perform in a lifetime. Supercomputers are already performing thousands of trillions (quadrillions) of instructions per second! To put
that in perspective, a quadrillion-instruction-per-second computer can perform in one second more than 100,000 calculations for every person on the planet! And&mdash;these "upper limits" are growing quickly!</p>
<p>Computers process data under the control of sets of instructions called computer programs. These programs guide
the computer through orderly sets of actions specified by people called computer programmers. The programs that run on a computer are referred to as software. In this book, you'll learn today's key programming methodology that's enhancing programmer productivity, thereby reducing software-development costs&mdash;object-oriented programming.</p>
<p>A computer consists of various devices referred to as hardware (e.g., the keyboard, screen, mouse, hard disks, memory, DVDs and processing units). Computing costs are dropping
dramatically, owing to rapid developments in hardware and software technologies. Computers that might have filled large rooms and cost millions of dollars decades ago are now inscribed on silicon chips smaller than a fingernail, costing perhaps a few dollars each. Ironically, silicon is one of the most abundant materials&mdash;it's an ingredient in common sand. Silicon-chip technology has made computing so economical that more than a billion general-purpose computers are in use
that more than a billion general-purpose computers are in use worldwide, and this is expected to double in the next few years.</p>
<p>Computer chips (microprocessors) control countless devices. These embedded systems include anti-lock brakes in cars, navigation systems, smart home appliances, home security systems, cell phones and smartphones, robots, intelligent traffic intersections, collision avoidance systems, video game controllers and more. The vast majority of the microprocessors produced each year are embedded in devices other than general-purpose computers.</p>
<footer>
<em>&copy; 2012 by Pearson Education, Inc.
All Rights Reserved.</em>
</footer>
</div>
</body>
</html>

In: Computer Science