Questions
The purpose of this homework is to test your knowledge of GUI. Consider a fictional park...

The purpose of this homework is to test your knowledge of GUI. Consider a fictional park where the entry price for 1 adult ticket is $50, and for 1 children ticket is $25. Write a simple GUI application that let user to enter the number of tickets and display the total price. The GUI should contain:

● One text field for the user to enter the number of adult tickets

● One text field for the user to enter the number of children tickets

● One button “Calculate total cost”

● One text field to display the total cost When the user clicks the button then the correct cost is displayed in the total price field. If the input text field is empty then it should be treated as 0 tickets.

In: Computer Science

// Lab Homework 11 // Logical Operator AND and OR // Demonstrate how to use a...

// Lab Homework 11
// Logical Operator AND and OR
// Demonstrate how to use a logical operator
// with a Boolean expression.

#include <iostream>
#include <cctype> // for tolower()
using namespace std;

int main()
{
   int numberOfCreditHours; // Number of credit hours student has completed
   float gpa; // The student's cumulative grade point average

   // Ask the user two questions:
   cout << "Answer the following questions:" << endl << endl;

   cout << "How many credit hours have you completed (0-200): ";
   cin >> numberOfCreditHours;

   cout << "What is your cumulative GPA (0.00-4.00)? ";
   cin >> gpa;

   cout << endl;

   // TODO: Students can petition for graduation if:
   // - they have completed 48+ credit hours
   // - they have a GPA of 2.0 or greater
   //
   // Use Logical operators in complex logical expressions to decide which of the following
   // four messages to print:
   //
   // 1) You may petition for graduation.
   // 2) You must raise your GPA before you can graduate.
   // 3) You must complete more credit hours before you can graduate.
   // 4) You must raise your GPA and complete more credits before graduating.
   //
   // Use just ONE of the logical operators below in the expression
   // to choose the approprate message. You MAY use the chosen operator
   //       more than once.
   //
   // Logical AND: &&
   // Logical OR: ||
   //
   // Note: Do NOT worry about situations where the user doesn't enter Y, y, N, or n

   // Use the if structure provided below.

   if // (<write a compound logic expression here for graduating>)
       //graduation message

   else if // (<write a compound logic expression here for too low gpa>)
       //raise gpa message

   else if // (<write a compound logic expression here for too few credits>)
       //complete more credits message

   else // else is good enough, no logic expression needed - it's the only other possibility
       // raise gpa and earn more credits message

   cout << endl << endl;

   return 0;
}

/* Sample interaction and output:

Test #1
==========================================
Answer the following questions:

How many credit hours have you completed (0-200): 60
What is your cumulative GPA (0.00-4.00)? 3.75

You may petition for graduation.

Press any key to continue . . .

Test #2
==========================================
Answer the following questions:

How many credit hours have you completed (0-200): 60
What is your cumulative GPA (0.00-4.00)? 1.99

You must raise your GPA before you can graduate.

Press any key to continue . . .

Test #3
==========================================
Answer the following questions:

How many credit hours have you completed (0-200): 47
What is your cumulative GPA (0.00-4.00)? 3.25

You must complete more credit hours before you can graduate.

Press any key to continue . . .

Test #4
==========================================
Answer the following questions:

How many credit hours have you completed (0-200): 45
What is your cumulative GPA (0.00-4.00)? 1.75

You must raise your GPA and complete more credits before graduating.

Press any key to continue . . .

*/

In: Computer Science

Prove that 2n+10 +n is O(2n)

Prove that 2n+10 +n is O(2n)

In: Computer Science

Make a program that swaps the three values. Three integer values are taken from the user...

  • Make a program that swaps the three values.
    • Three integer values are taken from the user input.
      • This work will be done by calling the function "getinput(num1, num2, num3)"
    • The input values are swapped each other by calling the function swap(num1, num2, num3)
      • example: values (a, b, c) will be (c, a, b) after the swap.
        • a = 10; b = 20; c = 30;
        • after function call,
          • a has 30, b has 10, and c has 20.

In: Computer Science

Please create (if not already in your linux home directory) files of any type. Once these...

Please create (if not already in your linux home directory) files of any type. Once these files are created, archive them, compress the archive and move these files to the thrash directory. This could be a script to be run from the shell or the script to be run from an executable file.

Submit your code and clearly explain all steps of your script.

In: Computer Science

Write pseudocode for quick find algorithm anf quick union algorithm Write pseudocode for quick find algorithm...

Write pseudocode for quick find algorithm anf quick union algorithm

Write pseudocode for quick find algorithm and quick union algorithm

In: Computer Science

quicksort the array step by step 63,19,32,11,87,3,87,24,48,39

quicksort the array step by step

63,19,32,11,87,3,87,24,48,39

In: Computer Science

Create a generic method to print objects in java. Include a tester class.

Create a generic method to print objects in java. Include a tester class.

In: Computer Science

Linux Create a simple 'user' file -user name, user id, some few other fields (at your...

Linux

Create a simple 'user' file -user name, user id, some few other fields (at your discretion). Name it 'users'. Enter about 10 entries there.

Create a simple 'user_data' file -user name, phone, address etc at your discretion.. User names in both files should match. So there would be 10 users in both files. You probably want to do these files as tab -separated, rather than space separated.

In: Computer Science

Why was the class-ful IP addressing scheme changed to class-less (CIDR) addressing?

Why was the class-ful IP addressing scheme changed to class-less (CIDR) addressing?

In: Computer Science

Discuss the inherent differences between ARP and NDP and what if any security vulnerabilities they have...

Discuss the inherent differences between ARP and NDP and what if any security vulnerabilities they have in common.

In: Computer Science

Write a brief description of a vulnerability found in the scan, including the operating system on...

  1. Write a brief description of a vulnerability found in the scan, including the operating system on which it was found, its risk factor, and its CVSS scores.
  2. Are the results of default scans different than the credentialed scan?
  3. Why might that be?
  4. What types of vulnerabilities might an attacker without any credentials be able to identify and exploit?
  5. This was a simple three computer LAN. How much more complicated would this process be for 100 computers? What about an enterprise with 10,000 computers on their LAN/WAN?
  6. Consider a cloud-hosted Infrastructure as a Service (IaaS) environment with many new, internet-accessible systems regularly being built and brought online. What advantages or challenges might there be with regard to vulnerability management in the cloud?

In: Computer Science

Make a function that swaps the values that change the values between the parameters as the...

  • Make a function that swaps the values that change the values between the parameters as the following rule.

  • The functions swap takes 2, 3 or 4 parameters and these functions are implemented as the overloading functions.

    • swap(int &, int &) : change the values each other.
      swap(int &, int &, int &) : change the value with the order. [min, medium, max]
      swap(int &, int &, int &, int &) : change the value like circular-shift-right [A, B, C, D] = > [B, C, D, A]
    • For Example,
      • num1 = 15; num2 = 5; num3 = 30; num4 =40;
      • swap(num1, num2);
        • num1 will be 5 and num2 will be 15
      • swap(num1, num2, num3)
        • num1 will be 5, num2 will be 15, and num3 is 30
      • swap(num1, num2, num3, num4)
        • num1 is 5, num2 is 30, num3 is 40 and num4 is 15

In: Computer Science

Write a Python program in a file called consonants.py, to solve the following problem using a...

Write a Python program in a file called consonants.py, to solve the following problem using a nested loop. For each input word, replace each consonant in the word with a question mark (?). Your program should print the original word and a count of the number of consonants replaced. Assume that the number of words to be processed is not known, hence a sentinel value (maybe "zzz") should be used. Sample input/output:

Please enter a word or zzz to quit: Dramatics

The original word is: dramatics

The word without consonants is: ??a?a?i??

The number of consonants in the word are: 6

Please enter another word or zzz to quit: latchstring

The original word is: latchstring

The word without consonants is: ?a??????i??

The number of consonants in the word are: 9

Please enter another word or zzz to quit: YELLOW

The original word is: yellow

The word without consonants is: ?e??o?

The number of consonants in the word are: 4

Please enter another word or zzz to quit: zZz

In: Computer Science

How do I count CAG number in DNA using python? please provide an example!

How do I count CAG number in DNA using python? please provide an example!

In: Computer Science