Questions
What is the entry returned by the peek() method after the following operations on a stack:...

What is the entry returned by the peek() method after the following operations on a stack:
push(A), push(R), pop(), push(D),  pop(), push(L), pop(), push(J), push(S), pop(), pop()

Group of answer choices

A

S

L

D

J

Which of the following is true about the Stack interface we implemented in class?

Group of answer choices

You can only pop from the top of the stack but you can peek at any entry on the stack

The bottom item in a stack is the last item added

The first item added to a stack is the first one removed

To access the item at the bottom of the stack we have to pop() all items on top of it

None of the above is true

The postfix expression corresponding to a + (c - d) / (b * r) is

Group of answer choices

a c d - b r * / +

a c d - + b r * /

a + c d - / b r *

a c + d * b r - /

none of the above

The postfix expression a b * c + d - is equivalent to the following infix expression

Group of answer choices

d - c + b * a

d - (c + b * a)

a * ( b + c - d)

a * b + c - d

None of the above

In: Computer Science

Explain IOT and provide three examples and applications of this technology in Business

Explain IOT and provide three examples and applications of this technology in Business

In: Computer Science

c++ example of a double linked list of chars I need to create a double linked...

c++ example of a double linked list of chars

I need to create a double linked list of chars. this should be a class that allows you to input a single character at a time, list the resulting characters, find any character and delete the first example of a character.

In: Computer Science

Rattapoom is a boy that loves to play with numbers. He received digit cards as a...

Rattapoom is a boy that loves to play with numbers. He received digit cards as a present on his birthday, where he joyously showed it to his friends in the neighborhood. He received N cards of number, where each card contains a single digit. He wishes to arrange all his cards in such a way that the digits form a smallest possible N-digit number, and that N-digit number must not begin with 0.

Given N digit cards that Rattapoom received, arrange the digits to form an N-digit number that is the smallest possible and does not start with 0.

INPUT

The first line defines an integer N (2 ≤ N ≤ 1,000). The next line defines a sequence of N digits, separated by whitespace, representing each card of digit. Assume that there will be at least one digit that is not zero.

OUTPUT

A line holding an N-digit number that does not start with 0. All digits are displayed without any whitespaces in between them.

Sample Input

Sample Output

4

9 4 6 2

2469

6

3 0 8 1 3 3

103338

Write a Java program using methods to implement this case.

In: Computer Science

The following postfix expression 2 6 + 3 5 - / evaluates to Group of answer...

The following postfix expression
2 6 + 3 5 - /
evaluates to

Group of answer choices

-1

1

-4

4

this is not a postfix expression

In an array implementation of the StackInterface where push() and pop() are O(1), the top of the stack is

Group of answer choices

the first entry in the array

the last occupied entry in the array

the second entry in the array

the entry before the last ocuppied entry in the array

the first or the last occupied entry in the array

In ArrayStack implementation of StackInterface, what value of topIndex indicates that the stack is empty?

Group of answer choices

-1

0

1

null

None of the above

When you remove an item from a stack, you remove it from

Group of answer choices

top

bottom

the middle

wherever the client specifies

none of the above

In: Computer Science

Prove that (m → s) → (¬s → ¬m) ⇔ 1 using Boolean algebra and Propositional...

Prove that (m → s) → (¬s → ¬m) ⇔ 1 using Boolean algebra and Propositional calculus

In: Computer Science

Email username generator Write an application that asks the user to enter first name and last...

Email username generator Write an application that asks the user to enter first name and last name. Generate the username from the first five letters of the last name, followed by the first two letters of the first name. Use the .toLowerCase() method to insure all strings are lower case. String aString = “Abcd” aString.toLowerCase(); aString = abcd Use aString.substring(start position, end position + 1) aString.substring(0, 3) yields the first 3 letters of a string If the last name is no more than five letters, use the entire name. If it is more than five letters, use the first 5 letters Print the email username you generated with @myCollege.edu appended

In: Computer Science

A vehicle’s VIN is very important for any and all paperwork, such as lease agreements, insurance...

A vehicle’s VIN is very important for any and all paperwork, such as lease agreements, insurance details, servicing schedules, etc. The code needed to check a 17-digit VIN can be very cumbersome. So instead, we’ll use a simplified version of a VIN for this database, which is defined as follows:

• A VIN is a string of exactly 5 characters

• Each character in a VIN is a digit or an uppercase letter

• A VIN can contain any of the digits 0 to 9

• A VIN can contain any uppercase letter except I, O, and Q

• The 3rd character of a VIN is either a digit from 0 to 9 or the letter X.

Use SQL check constraints to make sure this is implemented in your database. A check constraint is a boolean expression associated with a single column using the keyword CHECK. Every time the value in that column is altered (or inserted) the system will check that the boolean expression is still true with the new value. The system will then check the condition when an UPDATE statement is attempted, and prohibit the operation if the changed value violates the condition. Add a CHECK constraint to the table Vehicle to ensure that the VIN always meets the basic requirements above. You may need to look up the documentation for CHECK on sqlite.org to double-check the exact syntax.

In: Computer Science

Java programming : Your task is to create an application that takes orders for beach holidays,...

Java programming :

Your task is to create an application that takes orders for beach holidays, calculates, and displays the total cost.

Cost is $100 per day for accommodation

Wind surfing rental is $50 per day (not optional)

Sales tax is 7 %

The orders for this application will be how many days they wanna spend at the resort and for how many days do they want the wind surfing rental.

In: Computer Science

Calculate TCP and UDP efficiency while sending data of size 200 bytes? Justify the difference between...

Calculate TCP and UDP efficiency while sending data of size 200 bytes? Justify the difference between two.

In: Computer Science

(Fraction calculator c++) | Write a program that lets the user perform arithmetic operations on fractions....

(Fraction calculator c++) | Write a program that lets the user perform arithmetic operations on fractions. Fractions are of the form a/b, in which _a_ and _b_ are integers and b ≠ 0. Your program must be menu driven, allowing the user to select the operation (+, –, *, or /) and input the numerator and denominator of each fraction. Furthermore, your program must consist of at least the following functions: Function menu: This function informs the user about the program’s purpose, explains how to enter data, and allows the user to select the operation. Function addFractions: This function takes as input four integers representing the numerators and denominators of two fractions, adds the fractions, and returns the numerator and denominator of the result. (Notice that this function has a total of six parameters.) Function subtractFractions: This function takes as input four integers representing the numerators and denominators of two fractions, subtracts the fractions, and returns the numerator and denominator of the result. (Notice that this function has a total of six parameters.) Function multiplyFractions: This function takes as input four integers representing the numerators and denominators of two fractions, multiplies the fractions, and returns the numerators and denominators of the result. (Notice that this function has a total of six parameters.) Function divideFractions: This function takes as input four integers representing the numerators and denominators of two fractions, divides the fractions, and returns the numerator and denominator of the result. (Notice that this function has a total of six parameters.) Some sample outputs are: 3 / 4 + 2 / 5 = 23 / 20 2 / 3 * 3 / 5 = 6 / 15 Your answer need not be in the lowest terms.

In: Computer Science

Define and implement class Course. This class should contain the following fields: course name, course description,...

Define and implement class Course. This class should contain the following fields: course name, course description, department, time the course starts, weekday the course is held on (for simplicity, let us assume the course only meets once a week). This class should contain getters and setters for all its attributes. This class also needs at least one constructor. Save this class and its definition into a file named Course.java.

Define and implement class Student. This class should contain the following fields: first name, last name, age, gpa, major, department, courses. Age should be an integer value. GPA should be a floating point value. Courses should be a linked list of Course variables. Class Student should contain getters and setters for all its attributes. This class also needs at least one constructor. In class Student implement the following methods: addCourse() to add a new course, removeCourse() to remove a course from this student, sortCourses() to print out a sorted list of courses. Method sortCourses() should accept parameters to specify whether the sorting should be ascending or descending and also based on which course attribute to sort the courses. The output should be printed to command line standard output. Save this class and its definition into a file named Student.java.

In: Computer Science

Configuring Mail services in Linux In this lab we will examine how to configure mail server...

Configuring Mail services in Linux

In this lab we will examine how to configure mail server (Sendmail, Dovecot and Spamassassin) services under Linux.

PART 1: Configuring the sendmail Mail Transport Agent (MTA) to provide Mail server services

Boot your system into the Fedora Linux server VM used in lab 3 to configure DNS and follow the procedure outlined below to configure your system as a Mail server using the sendmail MTA.

  • Log in as usual and make sure that the Ethernet (ens33) bridged network interface is enabled.
  • Since the sendmail packages are not installed by default on the system (to verify this type rpm -qa | grep sendmail at the command prompt), issue the command (as root)

dnf install sendmail sendmail-cf to install the latest versions of these packages.

  • Next, using the applet on the top right of the desktop, disable the Ethernet (ens33) interface (we do this to avoid having your ISP DNS server appear in the system configuration). Make sure the Ethernet (ens37) interface is configured with a static IP address as you did in part 1 of lab 3 (i.e. 192.168.100.10 with mask 255.255.255.0); also make sure that the DNS server address is set to 192.168.100.10 (i.e. the localhost). Turn off and re-enable the ens37 interface for the changes to take effect. If necessary, refer to lab 3 for details on configuring interface settings.
  • Make sure that the BIND DNS server configuration is completed as described in part 2 of lab 3. In addition, using the BIND configuration GUI, add an MX record entry to the nspdomN.local forward zone. To do this, right-click the nspdomN.local zone and select Add – MX Mail Exchange. In the MXMail Exchange window, enter the Mail Server Name as F24server.nspdomN.local. (including the trailing period, N is your unique number) and click OK. Click Save on the toolbar and then click Yes to save the changes you have made. Restart the DNS service by typing systemctl restart named.service.
  • To set up the Mail server we first have to configure the file /etc/mail/sendmail.mc (we do not want to edit the configuration file /etc/mail/sendmail.cf directly since errors in this file can create problems) and then start the service. Open a terminal window as root, and back up the existing configuration file by typing

cp /etc/mail/sendmail.mc /etc/mail/sendmail.mc.bak. Also, back up the sendmail.cf file using a similar command.

NOTE: Usually, the sendmail service is configured to start automatically at boot, so you only have to restart the service when making changes to the configuration files.

  • Using the gedit editor, edit the /etc/mail/sendmail.mc file and make the following changes:
  1. Change the domain name specified in the LOCAL_DOMAIN directive from localhost.localdomain to nspdomN.local (with no trailing period).

  1. The default configuration file does not allow sendmail to accept network connections from any other host other than the local computer. To configure sendmail as a server for other clients, completely remove the Addr=127.0.0.1 option of the DAEMON_OPTIONS directive.

NOTE: If you would like sendmail to accept connections from the local subnet only, you need to change the address in the Addr= option to the IP address of the ens8 interface (i.e. Addr=192.168.100.10). DO NOT MAKE THIS CHANGE!

  1. To have sendmail masquerade other host names on the network, so that their return address is [email protected] instead of [email protected] (this is useful when a single machine acts as a mail gateway for all machines on the network and assigns a consistent return address to all outgoing mail), uncomment (i.e. remove the letters dnl in front of) the MASQUERADE_AS directive, and change the name in this directive from mydomain.com to nspdomN.local. Also uncomment the lines FEATURE(masquerade_envelope) and FEATURE(masquerade_entire_domain) and add the directive MASQUERADE_DOMAIN(.nspdomN.local)dnl.

  1. DO NOT MAKE THIS CHANGE AS IT MAY PREVENT SENDMAIL FROM WORKING – JUST READ IT!

As configured by default, sendmail accepts e-mail from domains that it cannot resolve (and that may not exist). To turn this feature off and cut down the amount of spam you receive, add dnl to the beginning of the following line:

FEATURE(`accept_unresolvable_domains’)dnl

When this feature is off, sendmail uses DNS to look up the domains of all e-mails it receives. If it cannot resolve the domain, it rejects the e-mail.

NOTE: Please refer to page 743 – 752 in Sobell and chapter 10 of the Fedora 22 system administrator guide for more details.

  • Finally we need to specify which systems the local server relays e-mail for. To do this edit the file /etc/mail/access and add the line

Connect:192.168.100.                       RELAY

at the end of the file. This line will allow the server to relay outbound e-mail for all hosts on the local virtual subnet.

  • To enable and start the sendmail service enter the command systemctl enable sendmail.service followed by systemctl start sendmail.service.
  • The Mail server should now be functional. Test this by opening a terminal as user student and sending e-mail to the user itself. Type echo “my sendmail test” | /sbin/sendmail [email protected]

and then type less /var/spool/mail/student and scroll to the bottom of the file to see if the new message has been appended to the student mail spool file.

WHAT TO SUBMIT: Capture of system-config-bind GUI on Linux server showing MX record added. Capture of Linux server terminal window showing output of echo command above.

2 captures total.

In: Computer Science

Apply a “stepwise refi nement approach” to develop three different levels of procedural abstractions for one...

Apply a “stepwise refi nement approach” to develop three different levels of procedural abstractions for one or more of the following programs: (1) Develop a check writer that, given a numeric dollar amount, will print the amount in words normally required on a check. (2) Iteratively solve for the roots of a transcendental equation.

(3) Develop a simple task-scheduling algorithm for an operating system.

i need 3rd part solution because 1st 2 parts are already answerd.

In: Computer Science

* what are pseudocode and flowcharts and what are they used for? * how to interpret...

* what are pseudocode and flowcharts and what are they used for?

* how to interpret branching and looping logic?

* What is the difference between the two types of identifiers?

* What is the difference between two types of containers?

* what are functions and methods and what are they used for?

* what objects are?

In: Computer Science