Questions
goal of this function will be to add an element to an already existing array in...

goal of this function will be to add an element to an already existing array in C/C++.

bool add(structure dir[], int& size, const char nm[], const char ph[]){

//code here

}

add = function name

structure = structure with two fields

{

char name[20];

char phone[13];

}

int& size = # of entries in dir

nm = name that's going to be added

ph = phone that's going to be added.

return true if entry was successfully added, false if there's no more room.

if entry was added, size will reflect the new number of entries in dir.

In: Computer Science

Design a class named Message to represent a sentence or phrase. The class will contain: •...

Design a class named Message to represent a sentence or phrase. The class will contain: • a private string data field to hold the sentence or phrase. • A no-arg constructor with an empty string message.

• A constructor that create a message object with the specified string sentence or phrase.

• Accessor and mutator (getter/setter) for string data field.

• A method named getVowels ( ) that returns the number of vowels in a sentence or phrase.

• A method named getConsonants( ) that returns the number of consonants in a sentence or phrase.

• A method named getDigits( ) that returns the number of digits in a sentence or phrase.

• A method named getUpperCase( ) that returns the number of uppercase letters in a sentence or phrase.

• A method named getLowerCase( ) that returns the number of lowercase letters in a sentence or phrase. Draw a UML diagram for the Message class and then implement it. Write a test program to use the class and demonstrate all methods in the message class.

What do I include as part of the solution ?

• UML diagram for message class.

• Algorithms (flowchart or pseudocode, 25 pts)

for the following methods: getVowels(), getConsonants( ), getDigits (), getUpperCase ( ), getLowerCase ( ). Use a pdf file to submit the flowchart. Remember to include a legend of the variables used as part of the solution.

• JAVA source codes (source.java) – class and demo program ( 25 pts )

In: Computer Science

Benefits Plus is health insurance company that pays medical and hospital claims of the policy holders....

Benefits Plus is health insurance company that pays medical and hospital claims of the policy holders.

In order to have policyholders claims processed, policy holders must submit a claim form. All claims are either mailed or presented in person to Benefits Plus' Claims Processing Department. Claims forms are first checked by Claims Screening Clerks and any incomplete forms are returned to the claimant (policyholder) for completion. Details of those incomplete forms which are returned to the policy holder are first entered in a Claim Pending File. Each week this file is checked and any pending claims more than 45 days old are removed and the policyholder is notified by a letter that their case has been closed.

All complete forms, including those pending claims which have been resubmitted, are then passed to the Claims Clerks who sort them according to the type of claim and assign a claim number to each claim form. The claims clerk then retrieves the policyholder's policy record from the Policy Files and records policy and claim action details on the claim form. The policy record is also updated with details of the current claim and then refiled. A benefits cheque is then prepared and sent to the claimant along with a tear-off slip from the original claim form. The tear-off slip serves as the claimant's record of their claim. Processed claim forms are filed by claim number after first being microfilmed for archival storage purposes.

At the end of each day a summary of all claims processed is sent to the Claim Payments Records Section.

(A) Draw Context Level Data Flow Diagram

(B) Draw Level 0 Data Flow Diagram for the situations described above.

Please add the diagram file in answer.

In: Computer Science

PYTHON. Create a function that accepts a filename where in each line there is a name...

PYTHON. Create a function that accepts a filename where in each line there is a name of a type of bird. use a python dictionary in order to count the # of time each bird appears. (1 line = 1 appearance) Loop over your dict. to print each species and the # of times it was seen in the file once all lines have been counted. return dictionary containing count

the filename opens this:

blackbird

canary

hummingbird

canary

hummingbird

canary

example of outcome. Blackbird,1

Hummingbird,2

Canary,3

In: Computer Science

Find the integer a such that a≡-43mod23and-22≤a≤0. a≡17mod29 and-14≤a≤14. a≡-11mod21 and 90≤a≤110.

  1. Find the integer a such that
    1. a≡-43mod23and-22≤a≤0.
    2. a≡17mod29 and-14≤a≤14.
    3. a≡-11mod21 and 90≤a≤110.

In: Computer Science

Task 1 Write a program that allocates an array large enough to hold 5 student test...

Task 1

Write a program that allocates an array large enough to hold 5 student test scores. Once all the scores are entered, the array should be passed to a function that sorts them in ascending order. Another function should be called that calculates the average score. The program should display the sorted list of scores and averages with appropriate headings.

Input Validation: Do not accept negative numbers for test scores.

Task 2

Modify the program so the lowest test score is dropped. This score should not be included in the calculation of the average.

Task 3

Modify the program to allow the user to enter name-score pairs. For each student taking a test, the user types the student’s name followed by the student’s integer test score. Modify the sorting function so it takes an array holding the student names and an array holding the student test scores. When the sorted list of scores is displayed, each student’s name should be displayed along with his or her score.

C++

In: Computer Science

In Java please Consider the following problem: There are three pegs, denoted A, B, and C,...

In Java please

Consider the following problem: There are three pegs, denoted A, B, and C, and N disks of different sizes. Originally, all the disks are on peg A, stacked in decreasing size from bottom to top. Your goal is to transfer all the disks to peg B, and the rules are that you can only move one disk at a time, no disk can be moved onto a smaller one, and you make use of all pegs.

Develop a solution to this problem based on the principle of recursion, i.e., this problem has to be solved by programming a recursive procedure. The use of global variables is not permitted. Your solution must print a protocol about the movements of the disks. Use only pseudocode to write down your solution.

In: Computer Science

For this lab, you will be writing method definitions. These method definitions will be based on...

For this lab, you will be writing method definitions. These method definitions will be based on method calls I have already written for you. Do all of the following steps in order. DO NOT move onto the next step until the previous one is complete.

1. Download the starting file called Lab10.java.

2. Within this file, you will find a completely written main method. Please DO NOT modify this code. Do read the code and familiarize yourself with what it does. Specifically focus on the method calls.

3. Write the method stubs (just like we did in class) for all the methods. Once you complete this, the program will compile and you will be able to test each method as you write it completely. Remember, a method stub includes the method name, all input parameters and the output type. If the method returns a value, you should write a return statement that just returns a default value. Without this, it will not compile. Therefore, the method body should only be one line of code. In doing this you must ask yourself the following questions for each:

a. What information does the method need?

b. What information should the method return?

c. What is the method name?

4. Write a JavaDoc method header for each method. This will include a method description and any necessary parameter and return value descriptions. Make sure you view the Java documentation to see if your JavaDoc code works.

5. Write the method definitions one by one for all methods, testing after each one. Think about how the method will accomplish its task.

6. In the main method, I have included lots of tests for each method. Make sure to test each method as you write it. The main method should run completely once you have all of the method definitions correctly written.

NOTE: We will cover method overloading next class. The third method called luckySum requires this concept.

This is a java project. Since I couldn't attach the file I copy and pasted the file below

import java.util.Scanner;

/**
* This is the starting file for Lab 10.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Lab10
{
/**
* The main method tests all four method definitions.
*
* @param args A string array of input arguments
*/
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
  
/**
* Method one checks to see if a number is even or odd.
*/
System.out.println("Testing method one");
  
// Test with real value
String ans1 = evenOrOdd(7); // odd
System.out.println("7 is an " + ans1 + " number.");
  
// Test with user input
System.out.println("Please enter an integer: ");
int num = input.nextInt();
String ans2 = evenOrOdd(num);
System.out.println("The integer is an " + ans2 + " number.");

/**
* Method two checks to see if either of the strings appears
* at the very end of the other string, ignoring upper/lower
* case differences (in other words, the computation should
* not be "case sensitive").
*/
System.out.println("\nTesting method two");
  
// Test with real values
boolean end1 = endOther("Hiabc", "abc"); // true
boolean end2 = endOther("AbC", "HiaBc"); // true
boolean end3 = endOther("abcXYZ", "abcDEF"); // false
System.out.println("The booleans are: " + end1 + ", " + end2 +
", " + end3);
  
// Test with user input
System.out.println();
System.out.println("Please enter the first string: ");
String first = input.next();
System.out.println("Please enter the second string: ");
String second = input.next();
  
boolean end4 = endOther(first, second);
if (end4) {
System.out.println("\nOne of the strings appears at the end of the other string.");
} else {
System.out.println("\nNeither of the strings appears at the end of the other string.");
}

/**
* This method should return the sum of three numbers.
* However, if one of the numbers is 13 then it does not
* count toward the sum and the parameters to its right
* do not count either. So, if the second number is 13,
* then the second and the third number do not count toward
* the sum.
*/
System.out.println("\nTesting method three");
  
// Test with real values
int sum1 = luckySum(4, 2, 3); // 9
int sum2 = luckySum(13, 2, 9); // 0
int sum3 = luckySum(9, 4, 13); // 13
double sum4 = luckySum(7.2, 3.4, 13.0); //10.6
double sum5 = luckySum(6.57, 13.0, 10.1); // 6.57
  
System.out.println("The lucky sums are: " + sum1 + ", " + sum2 +
", " + sum3 + ", " + sum4 + ", " + sum5);
// Test with user input
System.out.println("\nPlease enter the first number:");
int num1 = input.nextInt();
System.out.println("Please enter the second number:");
int num2 = input.nextInt();
System.out.println("Please enter the third number:");
int num3 = input.nextInt();
  
int lucky = luckySum(num1, num2, num3);
System.out.println("The lucky sum is " + lucky);
}
  
// Please write your methods here. Include JavaDoc method headers.

In: Computer Science

In Systems Analysis and Design, how do Functional and Structural modeling differ, in what ways, and...

In Systems Analysis and Design, how do Functional and Structural modeling differ, in what ways, and why are they always together in Analysis?

In: Computer Science

using lunix or C programming to answer this lab please fill in the blanks with the...

using lunix or C programming to answer this lab please fill in the blanks with the answere being highlighted, so i can understand.

First, type the following command:

            sort employee

What is the order that employee is sorted in? ___________________________________________

Give a brief description of how the file is sorted. _____________________________________________________________________________________________________________________________________________________________________________________________________

Now, sort on the field for last name.

        sort +1 employee

Look at the sorted file. Are all the names sorted in alphabetical order? ______________________

Give a brief description of the output.______________________________________________________________________________________________________________________________________________________________________________________________________________

Sort the file again using the following command:

            sort -f +1 employee

What happens when you sorted it this time? ________________________________________________________________________________________________________________________________________________________________________________________________________

Type in:

            sort +3 employee > hired1

Use the cat command to list out the file hired1 to see the results. Are the hire dates sorted in order? _______________  

If not, what has happened? _____________________________________________________________________________________________________________________________________________

Type in:

            sort -n +3 employee > hired2

What is the result of the sort? _______________________________________________________________________________________________________________________________________________

Type in:

            sort -nb +3.4 employee > hired3

What was the result? ________________________________________________________________________________________________________________________________________________

Briefly explain what happened. ____________________________________________________________________________________________________________________________________________

Type in:

            sort +0 +4n employee

What was the result? ________________________________________________________________________________________________________________________________________________

Were both columns sorted? __________________________

Type in the next command.

            sort +0 -1 +4n employee

What were the results of this output. Was the file sorted on both the department and also the salary field?

Subject

Book Title

Author's

Last Name

Author's

First Name

Pub.

Date

Price

UNIX:

Introduction to UNIX:

Wrightson:

Kate:

2003:

45.00:

UNIX:

Just Enough UNIX:

Anderson:

Paul:

2003:

39.00:

UNIX:

Bulletproof UNIX:

Gottleber:

Timothy

2002:

48.00:

UNIX:

Learning the Korn Shell:

Rosenblatt:

Bill:

1994:

35.95:

UNIX:

A Student's Guide to UNIX:

Hahn:

Harley:

1993:

24.50:

UNIX:

Unix Shells by Example:

Quigley:

Ellie:

1997:

49.95:

UNIX:

UNIX and Shell Programming:

Forouzan:

Behrouz:

2002:

80.00:

UNIX:

UNIX for Programmers and Users:

Glass:

Graham:

1993:

50.00:

SAS:

SAS Software Solutions:

Miron:

Thomas:

1993:

25.95:

SAS:

The Little SAS Book, A Primer:

Delwiche:

Lora:

1998:

35.00:

SAS:

Painless Windows for SAS Users:

Gilmore:

Jodie:

1999:

40.00:

SAS:

Getting Started with SAS Learning:

Smith:

Ashley:

2003:

99.00:

SAS:

The How to for SAS/GRAPH Software:

Miron:

Thomas:

1995:

45.00:

SAS:

The Output Delivery System:

Haworth:

Lauren:

2001:

48.00:

SAS:

Proc Tabulate by Example:

Haworth:

Lauren:

1999:

42.00:

SAS:

SAS Application Programming:

Dilorio:

Frank:

1991:

35.00:

SAS:

Applied Statistics & SAS Programming:

Cody:

Ronald:

1991:

29.50:

issue the command:

        sort -n -t: +4 books

What is the result? ________________________________________________________________________________________________________________________________________________

Try another sort using the books file. Sort on the price field in reverse. Type in the following:

        sort -nr -t: +5 books

What was the result? _______________________________________________________________________________________________________________________________________________

Try one more sort, this time saving the sort to a file. This sort will be on two fields. Put it into a new file called newbooks. Type in:

        sort -t: +0 +1 books > newbooks

Look at the file, newbooks. What does the sorted file look like now?

__________________________________________________________________________________________________________________________________________________________________

In: Computer Science

Write a program that inputs three integers in the range [1..13] that represent a hand of...

Write a program that inputs three integers in the range [1..13] that represent a hand of three cards. Your program should output an English evaluation of the hand.

In the output, cards will be described as follows:
- 2–10 are described by the words for their numeric values: two, three, etc.
- 1 is called an ace, 11 is called a jack, 12 is called a queen, and 13 is called a king.
The evaluation of a hand is based on the first of the following cases that matches the cards:
- All three cards are equal to each other.
Sample output for 4 4 4: You have three fours.
- The three cards form a straight (three successive values).
Sample output for 6 8 7: You have an eight-high straight.
- Two cards (a pair) are equal.
Sample output for 6 3 6: You have a pair of sixes.
- Whatever is the highest card.
Sample output for 11 1 8: You have a jack.

Recommend sorting the card values before trying to evaluate the hand –that makes it much easier. Also, work on one thing at a time: first determine what kind of hand (3 of kind, 2 of kind, straight,...) and then determine what is the “significant” card for that hand (it becomes very messy and exhausting if you try to do both at the same time!). Check for card values being equal to each other (card1 == card2), not specific values (card1 == 1 && card2 == 1 || card1 == 2 && card 2 == 2 || ...). If you check each value, your program will be hundreds of lines long!

In: Computer Science

Write a program in MIPS to find the largest element of an array, the array size...

  1. Write a program in MIPS to find the largest element of an array, the array size should be less than or equal to 10.

Has to be extremely basic, cannot use stuff like move. Very basic.

Here is what I already have and I am stuck.

.data
myarray: .word 0,0,0,0,0,0,0,0,0,0
invalid: .asciiz "Number is invalid, store a number in the array that is from 0-10.\n"
large: .asciiz "The largest element is "
colon: .asciiz " :\t"
enter: .asciiz "Store a value in the array "
.text

main:
li $v0, 4
la $a0, enter  #asking the user to input how many numbers they would like to enter
syscall

li $v0, 5
syscall #user input

add $s1, $v0, $0 #declaring v0 to s1

blt $s1, $0, error #if # isn't +
bgt $s1, 10, error #if # is greater than 10
beq $s1, $0, error #if # is 0

add $s0, $s1, $s2
addi $s0, $s1, -50

la $s6, myarray

sw $t0, 32($s6)

swap:
add $t0, $a1, $0
loop:
beq $t0, $t1, done
addi $s0, $s0, 4
add $s2, $s2, $t5

j loop

done: 
li $v0, 4
la $a0, large
syscall
#need to print biggest array here#
li $v0, 10
syscall

error:
li $v0, 4
la $a0, invalid
syscall

j main

In: Computer Science

Research the Windows PowerShell commands for manipulating the firewall and construct a command that lists all...

Research the Windows PowerShell commands for manipulating the firewall and construct a command that lists all the firewall rules on a system with the output containing the information and headers below:

Rule name

TCP port

Enabled

In: Computer Science

How do you see the impact of technologies like TelePresence on the workplace? On personal human...

How do you see the impact of technologies like TelePresence on the workplace? On personal human interactions? Are you in support of more or less face-to-face (FTF) interactions? Explain your answer. If you have used TelePresence or a similar solution at your work, please share your experience.

In: Computer Science

Assignment: (Save this file as A7-1.cpp) Write a program to calculate the gross pay for an...

Assignment: (Save this file as A7-1.cpp) Write a program to calculate the gross pay for an assembly line employee that works for a company that pays all assembly line workers $7.50 hour. Any employee that works over 40 hours per week is compensated by being paid time-and-one-half for each hour over 40. a. Use main( ) as the driver function. Allow the user to compute as many employees as desired. b. Write the function getName( ) that prompts for the name of the employee and returns it to main( ). c. Write the function getTime( ) that prompts the user for the time worked for that week and returns this value back to main( ). Do not allow the user to enter a negative value for the hours. Display an error message and keep prompting until a valid value is entered. d. Write the function computePay( ) that calculates the gross pay of the employee using the time entered by the user and returns the calculated gross pay back to main( ). e. Write the function displayPay( ) that takes as input the employee’s name, the gross pay and time worked from main( ) and displays these values.

In: Computer Science