Questions
Java) Write a program to score the rock-paper-scissor game. Each of two users types in either...

Java) Write a program to score the rock-paper-scissor game. Each of two users types in either R, P, S or Q to quit. The program then announces the winner as well as the basis for determining the winner: Paper covers rock, Rock breaks scissors, Scissors cut paper, or a Tie game. Allow the user to use lowercase as well as uppercase letters. Your program should loop until the user types a 'Q' to quit.

In the sample code, the game is enclosed within a do…while loop that keeps repeating while the user enters a 'Y' in response to the prompt "Do you want to play again? " The program exits if anything other than an upper-case or lower-case 'Y' is entered. For extra credit, add additional code at the end of the program to keep asking "Do you want to play again? " until the user enters either a 'Y' or 'N' and rejects any other response.(NEEDED)

In: Computer Science

Convert 11001001100101101011010011010111 from IEEE 754 to decimal show work

Convert 11001001100101101011010011010111 from IEEE 754 to decimal show work

In: Computer Science

Write a method in java (with out using startwith,boolean true false) count that counts how many...

Write a method in java (with out using startwith,boolean true false) count that counts how many times a substring occurs in a string:For example: count("is", "Mississippi") will return 2. also add comment besides code.

In: Computer Science

In this lab you will be encrypting a message. It is a simple encryption described in...

In this lab you will be encrypting a message. It is a simple encryption described in the problem. To program it remember that the ASCII code for ‘A’ is 65 and the other capital letters are in order 66, 67, 68, … The ASCII code for ‘a’ is 97 and the lowercase continues 98, 99, and so on. The hint is that a if a user type in a char with an ASCII code between 65 and 90, or 97 and 122 then add 5 and print out the result. Otherwise, have a sequence of if-statements to encrypt the punctuation marks as given in the problem. Keep looping until the character typed in is a ‘#’ symbol.

1. Write a C++ program that encrypts a message. The program should read in a character, “encrypt” the character by giving the numeric place the character has in the alphabet then add 5. The program should then printout the encrypted message to the screen. The program should continue taking in characters until the user types in a # symbol. Punctuation should be handled as follows: . A , B ? C ! D. No other characters will be encrypted.

In: Computer Science

Given a list of negative integers, write a Python program to display each integer in the...

Given a list of negative integers, write a Python program to display each integer in the list that is evenly divisible by either 5 or 7. Also, print how many of those integers were found.

Sample input/output:

Enter a negative integer (0 or positive to end): 5
Number of integers evenly divisible by either 5 or 7: 0

Sample input/output:

Enter a negative integer (0 or positive to end): -5
-5 is evenly divisible by either 5 or 7.
Enter a negative integer (0 or positive to end): -35
-35 is evenly divisible by either 5 or 7.
Enter a negative integer (0 or positive to end): -3
Enter a negative integer (0 or positive to end): -7
-7 is evenly divisible by either 5 or 7.
Enter a negative integer (0 or positive to end): 0
Number of integers evenly divisible by either 5 or 7: 3

In: Computer Science

Utilize the Outdoor Clubs & Product database to create a PL/SQL anonymous block program unit that...

Utilize the Outdoor Clubs & Product database to create a PL/SQL anonymous block program unit that lists the product_name attribute value and a demand status text display. The demand status text display is determined by counting the number of times a product has been ordered so far. The demand status text display will be either “Low Demand” or “High Demand”. Low Demand is displayed if the product has been ordered less than 2 times. High Demand is displayed if the product has been ordered more than 2 times. Save the PL/SQL anonymous block program unit as a script file. Due to the business rule of not carrying products that have low demand, reduce the price of products (by $1) that have low demand.

--- Database Tables --- _

id varchar2(4) constraint supplier_pk primary key, name varchar2(30), street varchar2(30), city varchar2(15), state char(2), zip number(5), phone varchar2(10)); create table product (product_id number(5) constraint product_pk primary key, product_name varchar2(30), quantity_in_stock number(3), reorder_point number(2), price number(5,2), supplier_id varchar2(4) constraint product_fk references supplier, reorder_qty number(2)); create table purchase_order (po_no varchar2(4) constraint purchase_order_pk primary key, po_date date, product_id number(5) constraint purchase_order_fk1 references product, quantity number(3), supplier_id varchar2(4) constraint purchase_order_fk2 references supplier); create table customer (customer_id number(3) constraint customer_pk primary key, first_name varchar2(10), last_name varchar2(10), street varchar2(30), city varchar2(15), state char(2)default 'MO', zip number(5), phone varchar2(10)); create table club_membership (membership_id number(5) constraint club_membership_pk primary key, membership_date date, duration number(2), amount number(4), payment_type varchar2(5)constraint membership_payment_type_ck check ((payment_type = 'CC') or (payment_type = 'Check')), club_id number(3) constraint club_membership_fk1 references sporting_clubs, customer_id number(3) constraint club_membership_fk2 references customer); create table product_order (order_id number(4) constraint product_order_pk primary key, order_date date, ship_date date, payment_type varchar2(5)constraint prod_order_payment_type_ck check ((payment_type = 'CC') or (payment_type = 'Check')), total number (6,2), customer_id number(3) constraint product_order_fk1 references customer); create table order_details (order_id number(4), product_id number(5), quantity number(2), constraint order_details_pk primary key (order_id,product_id), constraint order_details_fk1 foreign key (order_id) references product_order, constraint order_details_fk2 foreign key (product_id) references product); create sequence club_sequence start with 100 increment by 10 nocache; insert into sporting_clubs values(club_sequence.nextval, 'Hillside Mountain Club', '1 Winona St','Wichita','KS',34342,'3163997676'); insert into sporting_clubs values(club_sequence.nextval, 'Branson Climbing Club', '2 Sherwood Dr.','Branson','MO',65670,'4174485676'); insert into sporting_clubs values(club_sequence.nextval, 'Cherokee Rafting Club', '44 Kent Ave.','St. Charles','MO',66572,'3147780870'); insert into sporting_clubs values(club_sequence.nextval, 'White Plains Club', '225 Tracy St.','New York','NY',13567,'2126678090'); insert into club_activity values(100,'Hiking'); insert into club_activity values(100,'Climbing'); insert into club_activity values(100,'Walking'); insert into club_activity values(110,'Hiking'); insert into club_activity values(110,'Climbing'); insert into club_activity values(110,'Conservation'); insert into club_activity values(110,'Walking'); insert into club_activity values(120,'Conservation'); insert into club_activity values(120,'Canoeing'); insert into club_activity values(130,'Conservation'); insert into club_activity values(130,'Canoeing'); insert into club_activity values(130,'Walking'); create sequence supplier_sequence start with 500 increment by 10 nocache; insert into supplier values('S'||supplier_sequence.nextval,'Hillside Ski','2717 S. Western Ave.','Los Angeles','CA',90006,'7146654959'); insert into supplier values('S'||supplier_sequence.nextval,'Tiger Mountain','2600 S. Vermont Ave.','Los Angeles','CA',90006,'7143327878'); insert into supplier values('S'||supplier_sequence.nextval,'Asha Outdoor','44 S. LaSalle St.','Chicago','IL',60603,'3125554678'); insert into supplier values('S'||supplier_sequence.nextval,'Sheraton Recreation','225 Tracy St.','New York','NY',13567,'2128889569'); create sequence product_id_sequence start with 10010 increment by 1 nocache; insert into product values(product_id_sequence.nextval,'Beginner''s Ski Boot',20,5,9.75,'S500',25); insert into product values(product_id_sequence.nextval,'Intermediate Ski Boot',18,5,12.99,'S500',20); insert into product values(product_id_sequence.nextval,'Pro Ski Boot',21,7,15.49,'S510',25); insert into product values(product_id_sequence.nextval,'Beginner''s Ski Pole',15,3,25.49,'S500',20); insert into product values(product_id_sequence.nextval,'Intermediate Ski Pole',20,3,29.99,'S520',22); insert into product values(product_id_sequence.nextval,'Pro Ski Pole',21,5,34.99,'S530',25); insert into product values(product_id_sequence.nextval,'Road Bicycle',15,4,34.95,'S520',18); insert into product values(product_id_sequence.nextval,'Mountain Bicycle',19,4,49.99,'S520',20); insert into product values(product_id_sequence.nextval,'Tire Pump',8,2,7.99,'S530',10); insert into product values(product_id_sequence.nextval,'Water Bottle',25,4,2.49,'S510',25); insert into product values(product_id_sequence.nextval,'Bicycle Tires',30,5,4.99,'S500',33); insert into product values(product_id_sequence.nextval,'Bicycle Helmet',23,6,10.95,'S510',25); create sequence po_sequence start with 11 nocache; insert into purchase_order values('PO'||po_sequence.nextval,to_date('5/25/12','mm/dd/yy'),10011,20,'S500'); insert into purchase_order values('PO'||po_sequence.nextval,to_date('5/12/12','mm/dd/yy'),10015,25,'S530'); insert into purchase_order values('PO'||po_sequence.nextval,to_date('6/25/12','mm/dd/yy'),10011,20,'S500'); insert into purchase_order values('PO'||po_sequence.nextval,to_date('6/15/12','mm/dd/yy'),10018,10,'S530'); insert into purchase_order values('PO'||po_sequence.nextval,to_date('7/10/12','mm/dd/yy'),10015,25,'S530'); insert into purchase_order values('PO'||po_sequence.nextval,to_date('7/25/12','mm/dd/yy'),10019,25,'S510'); create sequence customer_sequence start with 101 nocache; insert into customer values(customer_sequence.nextval,'Jack','Russell','25 North Madison Ave.','Springfield','MO',65807,'4178823434'); insert into customer values(customer_sequence.nextval,'Betty','Trumbell','550 South Court Dr.','St. Louis','MO',63140,'3125556670'); insert into customer values(customer_sequence.nextval,'Anil','Kaul','400 South Circle St.','Kansas City','MO',64530,'4316667070'); insert into customer values(customer_sequence.nextval,'Tom','Wiley','1500 North Grand St.','Springfield','MO',65810,'4178825560'); insert into customer values(customer_sequence.nextval,'Sharon','Stone','200 West Wagner St.','Springfield','MO',65807,'4176668890'); create sequence membership_sequence start with 10010 increment by 10 nocache; insert into club_membership values(membership_sequence.nextval,to_date('6/12/12','mm/dd/yy'),4,200,'CC',100,101); insert into club_membership values(membership_sequence.nextval,to_date('6/15/12','mm/dd/yy'),2,100,'Check',110,102); insert into club_membership values(membership_sequence.nextval,to_date('6/21/12','mm/dd/yy'),5,250,'Check',120,103); create sequence product_order_sequence start with 1001 nocache; insert into product_order values(product_order_sequence.nextval,to_date('5/27/12','mm/dd/yy'),to_date('6/1/12','mm/dd/yy'),'CC',134.95,102); insert into product_order values(product_order_sequence.nextval,to_date('5/28/12','mm/dd/yy'),to_date('6/2/12','mm/dd/yy'),'CC',134.85,103); insert into product_order values(product_order_sequence.nextval,to_date('5/28/12','mm/dd/yy'),to_date('6/3/12','mm/dd/yy'),'Check',12.45,104); insert into product_order values(product_order_sequence.nextval,to_date('6/5/12','mm/dd/yy'),to_date('6/10/12','mm/dd/yy'),'CC',44.43,105); insert into product_order values(product_order_sequence.nextval,to_date('6/6/12','mm/dd/yy'),to_date('6/8/12','mm/dd/yy'),'Check',52.48,103); insert into product_order values(product_order_sequence.nextval,to_date('6/8/12','mm/dd/yy'),to_date('6/12/12','mm/dd/yy'),'CC',131.94,104); insert into order_details values(1001,10011,2); insert into order_details values(1001,10015,3); insert into order_details values(1002,10011,5); insert into order_details values(1002,10016,2); insert into order_details values(1003,10019,5); insert into order_details values(1004,10018,3); insert into order_details values(1004,10011,1); insert into order_details values(1004,10019,3); insert into order_details values(1005,10017,1); insert into order_details values(1005,10019,1); insert into order_details values(1005,10021,1); insert into order_details values(1006,10012,4); insert into order_details values(1006,10015,2); commit;

In: Computer Science

how to implement h / k sqrt (n) in c programing

how to implement h / k sqrt (n) in c programing

In: Computer Science

Form for a user to enter billing and shipping information. Checkbox that when clicked copies all...

Form for a user to enter billing and shipping information. Checkbox that when clicked copies all of the billing information to the shipping information. A submit button to make sure the text fields have been filled. Just trying to make a simple small webpage to order a couple Items like toys for instance nothing fancy or big just small and simple, a couple of text fields. That's all

JavaScript/HTML

In: Computer Science

Suppose you are given a string containing only the characters ( and ). In this problem,...

Suppose you are given a string containing only the characters ( and ). In this problem, you will write a function to determine whether the string has balanced parentheses. Your algorithm should use no more than O (1) space beyond the input; any algorithms that use space not in O (1) will receive half credit at most. Any solutions that always return true (or always return false) or otherwise try to game the distribution of test cases will receive zero credit.

Balanced parentheses means that every open parenthesis has exactly one close parenthesis corresponding to it and vice versa, and that for each pair the opening parenthesis precedes the closed parenthesis. The following strings have balanced parentheses: () (()()) ((())())

The following strings do not have balanced parentheses: )( (() ())(()))())

We consider the empty string to have balanced parentheses, as there is no imbalance. Your program should accept as input a single string containing only the characters ) and (, and output a single line stating true or false .

The functionality for reading and printing answers is written in the class; your task is to complete the hasBalancedParentheses() method.

In: Computer Science

HOW WOULD YOU WRITE THIS IN PYTHON? SHOW THIS IN PYTHON CODE PLEASE # DEFINE 'all_keywords',...

HOW WOULD YOU WRITE THIS IN PYTHON?
SHOW THIS IN PYTHON CODE PLEASE
# DEFINE 'all_keywords', A LIST COMPRISED OF ALL OUR NEGATIVE SEARCH KEYWORDS AS REQUIRED BY THE PROJECT
# FOR EACH ELEMENT IN 'full_list' (THE LIST OF LISTS YOU WOULD HAVE CREATD ABOVE THE PREVIOUS LINE)
#       INITIALIZE THE SET 'detected_keywords' TO EMPTY
#       DEFINE VARIABLE 'current_reviewer' FROM CURRENT ELEMENT OF 'full_list' BY EXTRACTING ITS FIRST SUB-ELEMENT,...
#       ...CONVERTING IT TO A STRING, AND THEN STRIPPING THE SUBSTRING '<Author>' OFF THIS STRING
#       GENERATE THE LIST 'separated_words' COMPRISED OF EACH SEPARATE WORD IN THIS REVIEWER'S COMMENTS, BY EXTRACTING THE SECOND SUB-ELEMENT...
#       ...FROM THE CURRENT ELEMENT AND EXECUTING THE '.split' METHOD ON IT
#       FOR EACH ELEMENT IN 'separated_words'
#               FOR EACH ELEMENT IN 'all_keywords'
#                       if LOWER-CASE OF 'all_keywords' IS CONTAINED IN LOWER-CASE OF 'separated_words'
#                               ADD THE CURRENT ELEMENT OF 'all_keywords' TO THE SET 'detected_keywords'
#       IF LENGTH OF 'detected_keywords' IS MORE THAN ZERO
#               PRINT A LINE SUCH AS -- XYZ USED THE FOLLOWING KEYWORDS: {'bad,'rough'}
#       ELSE
#               PRINT A LINE SUCH AS -- XYZ DID NOT USE ANY NEGATIVE KEYWORDS.

In: Computer Science

SOLVE IN C: Playing with encryption: Write a program that will read a four-digit integer entered...

SOLVE IN C: Playing with encryption:

Write a program that will read a four-digit integer entered by the user and encrypt it as follows: Replace each digit with the result of adding 7 to the digit and getting the remainder after dividing the new value by 10. Then swap the second digit with the fourth. Finally, print the original number and its encrypted one. Now reverse the process. Read an encrypted integer and decrypt it by reversing the algorithm to obtain the original number. Print out both the encrypted and decrypted integer.

need help finishing code on encryption in C I was assigned to encrypt and then decrypt a number by reversing the process to get it's original number. Here are the original instructions from my teacher:

I was able to encrypt, but now I am struggling with how to decrypt it back to it's original number. Here is my code:

You'll see my comment where I say I can't figure it out from a certain point and where the code needs to be fixed in bold.

#include
int main(){

int digit; // stores initial 4 digit integer value.
int digit1; // used to retrieve first digit.
int digit2; // retrieve second digit.
int digit3; // retrieve third digit.
int digit4; // retrieve fourth digit.
int swappedDigit; // the new encrypted digit value.

int decry; // stores initial 4 digit integer value.
int decry1; // first digit retrieval.
int decry2; // second digit retrieval.
int decry3; // third digit retrieval.
int decry4; // fourth digit retrieval.
int decrypt; // final decrypted digit.


printf("Enter a 4 digit number:\n");
scanf("%d", &digit);

/* the following 4 lines isolate each digit, as well as adding 7 to them and getting the remainder.
*/
digit1 = digit /1000 % 10;
digit1 = (digit1 + 7) % 10;


digit2 = digit /100 % 10;
digit2 = (digit2 + 7) %10;


digit3 = digit /10 % 10;
digit3 = (digit3 + 7) %10;


digit4 = digit % 10;
digit4 = (digit4 + 7) %10;

/* this formula below swaps the second and fourth numbers of the new decimal number from the formula above.
This gives us the new encrypted number. */

swappedDigit = (digit1 * 1000) + (digit2) + (digit3 * 10) + (digit4 * 100);

// printing the original number and the new encrypted number stored as "swappedDigit".
printf("The original digit is %d\n", digit);
printf("The encrypted digit is %d\n", swappedDigit);

// alerting the user to now input the same number to decrypt it by reversing the process.

printf("Now time to reverse the process.\n");
printf("Enter a 4 digit encrypted number:\n");
scanf("%d", &decry);


// this bottom part is all wrong. Not sure how to reverse it from here. Adding 3 only works for some numbers.

decry1 = decry /1000 % 10 + 3;
decry2 = decry /100 % 10 + 3;
decry3 = decry /10 % 10 + 3;
decry4 = decry % 10 + 3;

// swapping the second and fourth digits back to where they were originally.

decrypt = (decry1 * 1000) + (decry2) + (decry3 * 10) + (decry4 * 100);

// finally, printing the original decrypted number.

printf("The decrypted number is %d", decrypt);


   return 0;
}

In: Computer Science

Step me through an illustrated example (including all needed variables/arrows) of a Linked-List of size 5,...

Step me through an illustrated example (including all needed variables/arrows) of a Linked-List of size 5, where the positions of nodes 3 and 4 are swapped.

In: Computer Science

Hello, I need to divide my code in this different parts. Use a standard approach to...

Hello, I need to divide my code in this different parts.

Use a standard approach to source files in this assignment: a .cpp for each function (you have at least two – main and ageCalc) a header file for the student struct, properly guarded

Code:

#include <iostream>

#include <string>

#include <fstream>

#include <algorithm>

#include <vector>

#include <iomanip>

using namespace std;

#define nullptr NULL

#define MAX_SIZE 100

struct Student

{

    string firstName;

    char middleName;

    string lastName;

    char collegeCode;

    int locCode;

    int seqCode;

    int age;

};

struct sort_by_age

{

    inline bool operator()(const Student *s1, const Student *s2)

    {

        return (s1->age < s2->age);

    }

};

int ageCalc(Student *studs[], Student *&youngest);

int main()

{

    Student *students[MAX_SIZE] = {nullptr};

    ifstream Myfile;

    Myfile.open("a2data.txt");

    if (!Myfile.is_open())

    {

        cout << "Could not open the file!";

        return 1;

    }

    vector<string> words;

    string line;

    while (!Myfile.eof())

    {

        getline(Myfile, line);

        line.c_str();

        int i = 0;

        string word = "";

        while (line[i] != '\0')

        {

            if (line[i] != ' ')

            {

                word = word + line[i];

                i++;

            }

            else

            {

                if (word != "")

                    words.push_back(word);

                word = "";

                i++;

            }

        }

        words.push_back(word);

    }

    Myfile.close();

    int count = 0;

    string fname = words.at(count);

    count++;

    int n = 0;

    while (count < words.size() - 2)

    {

        Student *s = new Student;

        s->firstName = fname;

        string mname = words.at(count);

        s->middleName = mname[0];

        count++;

        s->lastName = words.at(count);

        if (words.at(count).size() >= 12)

        {

            if (words.at(count)[1] >= '0' && words.at(count)[1] <= '9')

            {

                count--;

                s->middleName = ' ';

                s->lastName = words.at(count);

            }

        }

        count++;

        string id = words.at(count);

        count++;

        s->collegeCode = id[0];

        string loc = "";

        loc = loc + id[1];

        loc = loc + id[2];

        s->locCode = stoi(loc);

        string seq = "";

        for (int j = 3; j < 9; j++)

        {

            seq = seq + id[j];

        }

        s->seqCode = stoi(seq);

        string age = "";

        age = age + id[9];

        age = age + id[10];

        age = age + id[11];

        s->age = stoi(age);

        fname = id.erase(0, 12);

        students[n] = s;

        n++;

    }

    words.clear();

    sort(students, students + n, sort_by_age());

    cout << setw(15) << left << "Last Name";

    cout << setw(15) << left << "Midlle Name";

    cout << setw(15) << left << "First Name";

    cout << setw(15) << left << "College Code";

    cout << setw(12) << left << "Location";

    cout << setw(12) << left << "Sequence";

    cout << setw(12) << left << "Age" << endl;

    cout << "=======================================================================================" << endl;

    for (int i = 0; i < n; i++)

    {

        cout << setw(15) << left << students[i]->lastName;

        cout << setw(15) << left << students[i]->middleName;

        cout << setw(20) << left << students[i]->firstName;

        cout << setw(13) << left << students[i]->collegeCode;

        cout << setw(10) << left << students[i]->locCode;

        cout << setw(12) << left << students[i]->seqCode;

        cout << students[i]->age << endl;

    }

    cout << endl;

    Student *youngest = NULL;

    int avg_age = ageCalc(students, youngest);

    cout << "Average age is: " << avg_age << endl;

    cout << "Youngest student is " << youngest->firstName << " " << youngest->middleName << " " << youngest->lastName << endl;

    return 0;

}

int ageCalc(Student *studs[], Student *&youngest)

{

    youngest = studs[0];

    int i = 0;

    int avg_age = 0;

    while (studs[i] != NULL)

    {

        avg_age += studs[i]->age;

        if (youngest->age > studs[i]->age)

            youngest = studs[i];

        i++;

    }

    return avg_age / i;

}

File needed:

https://drive.google.com/file/d/15_CxuGnFdnyIj6zhSC11oSgKEYrosHck/view?usp=sharing

In: Computer Science

Hello, I need to divide my code in this different parts. Use a standard approach to...

Hello, I need to divide my code in this different parts.

Use a standard approach to source files in this assignment: a .cpp for each function (you have at least two – main and ageCalc) a header file for the student struct, properly guarded

Code:

#include <iostream>

#include <string>

#include <fstream>

#include <algorithm>

#include <vector>

#include <iomanip>

using namespace std;

#define nullptr NULL

#define MAX_SIZE 100

struct Student

{

    string firstName;

    char middleName;

    string lastName;

    char collegeCode;

    int locCode;

    int seqCode;

    int age;

};

struct sort_by_age

{

    inline bool operator()(const Student *s1, const Student *s2)

    {

        return (s1->age < s2->age);

    }

};

int ageCalc(Student *studs[], Student *&youngest);

int main()

{

    Student *students[MAX_SIZE] = {nullptr};

    ifstream Myfile;

    Myfile.open("a2data.txt");

    if (!Myfile.is_open())

    {

        cout << "Could not open the file!";

        return 1;

    }

    vector<string> words;

    string line;

    while (!Myfile.eof())

    {

        getline(Myfile, line);

        line.c_str();

        int i = 0;

        string word = "";

        while (line[i] != '\0')

        {

            if (line[i] != ' ')

            {

                word = word + line[i];

                i++;

            }

            else

            {

                if (word != "")

                    words.push_back(word);

                word = "";

                i++;

            }

        }

        words.push_back(word);

    }

    Myfile.close();

    int count = 0;

    string fname = words.at(count);

    count++;

    int n = 0;

    while (count < words.size() - 2)

    {

        Student *s = new Student;

        s->firstName = fname;

        string mname = words.at(count);

        s->middleName = mname[0];

        count++;

        s->lastName = words.at(count);

        if (words.at(count).size() >= 12)

        {

            if (words.at(count)[1] >= '0' && words.at(count)[1] <= '9')

            {

                count--;

                s->middleName = ' ';

                s->lastName = words.at(count);

            }

        }

        count++;

        string id = words.at(count);

        count++;

        s->collegeCode = id[0];

        string loc = "";

        loc = loc + id[1];

        loc = loc + id[2];

        s->locCode = stoi(loc);

        string seq = "";

        for (int j = 3; j < 9; j++)

        {

            seq = seq + id[j];

        }

        s->seqCode = stoi(seq);

        string age = "";

        age = age + id[9];

        age = age + id[10];

        age = age + id[11];

        s->age = stoi(age);

        fname = id.erase(0, 12);

        students[n] = s;

        n++;

    }

    words.clear();

    sort(students, students + n, sort_by_age());

    cout << setw(15) << left << "Last Name";

    cout << setw(15) << left << "Midlle Name";

    cout << setw(15) << left << "First Name";

    cout << setw(15) << left << "College Code";

    cout << setw(12) << left << "Location";

    cout << setw(12) << left << "Sequence";

    cout << setw(12) << left << "Age" << endl;

    cout << "=======================================================================================" << endl;

    for (int i = 0; i < n; i++)

    {

        cout << setw(15) << left << students[i]->lastName;

        cout << setw(15) << left << students[i]->middleName;

        cout << setw(20) << left << students[i]->firstName;

        cout << setw(13) << left << students[i]->collegeCode;

        cout << setw(10) << left << students[i]->locCode;

        cout << setw(12) << left << students[i]->seqCode;

        cout << students[i]->age << endl;

    }

    cout << endl;

    Student *youngest = NULL;

    int avg_age = ageCalc(students, youngest);

    cout << "Average age is: " << avg_age << endl;

    cout << "Youngest student is " << youngest->firstName << " " << youngest->middleName << " " << youngest->lastName << endl;

    return 0;

}

int ageCalc(Student *studs[], Student *&youngest)

{

    youngest = studs[0];

    int i = 0;

    int avg_age = 0;

    while (studs[i] != NULL)

    {

        avg_age += studs[i]->age;

        if (youngest->age > studs[i]->age)

            youngest = studs[i];

        i++;

    }

    return avg_age / i;

}

File needed:

https://drive.google.com/file/d/15_CxuGnFdnyIj6zhSC11oSgKEYrosHck/view?usp=sharing

In: Computer Science

Using PHP Provide and the ability for the user to determine their userid and to change...

Using PHP

Provide and the ability for the user to determine their userid and to change their password if they forget either.

Also, provide the ability for the user to change the password whenever they chose. If they are changing their password (when they know the password), they must be required to enter the old password, and then the new password (twice).

Anytime the password is changed it must verify the correct format of the password as previously mentioned in other assignments.

Make sure that your program works properly.

In: Computer Science