Questions
find the projection vector of the vector v = (2,3,5) onto the plane z = 2x...

find the projection vector of the vector v = (2,3,5) onto the plane z = 2x + 3y -1

In: Advanced Math

Give a formal proof for the following tautology by using the CP rule. A v B→(¬...

Give a formal proof for the following tautology by using the CP rule.

A v B→(¬ B →(A ^ ¬ B))

In: Computer Science

Calculate how many milligrams of the drug are contained in 2.0mL of a 3.0% (w/v) solution...

Calculate how many milligrams of the drug are contained in 2.0mL of a 3.0% (w/v) solution ofC17H19N3O3S

In: Chemistry

How do you get from Power = work/time to Power = v^2/r ?

How do you get from Power = work/time to Power = v^2/r ?

In: Physics

Choose a psychological disorder from the DSM-V. Neurocognitive Disorders (591) Summarize the symptoms of the disorder.

Choose a psychological disorder from the DSM-V.

Neurocognitive Disorders (591)

  • Summarize the symptoms of the disorder.

In: Psychology

Suppose that ? and ? are subspaces of a vector space ? with ? = ?...

Suppose that ? and ? are subspaces of a vector space ? with ? = ? ⊕ ?. Suppose also that ??, … , ?? is a basis of ? amd ??, … , ?? is a basis of ?. Prove ??, … , ??, ??, … , ?? is a basis of V.

In: Advanced Math

where does the formula v = sqr(2gh) come from (what formula is it a simplification of...

where does the formula v = sqr(2gh) come from (what formula is it a simplification of and how)

In: Physics

Write a class called CheckUserName. CheckUserName must have a main method. Your program must ask for...

Write a class called CheckUserName.

CheckUserName must have a main method.

Your program must ask for a user name.  If the name is on the list
below (Liam, for example) greet the user saying:

welcome back: Liam

If the user is an admin (like Benkamin, for example) print:

welcome back: Benjamin
you have admin privileges

Your program must accept upper case or lower case:

emacs% java CheckUserName
enter a user name: Liam
welcome back: Liam
emacs% java CheckUserName
enter a user name: liam
welcome back: liam


Here is the list of users:

Liam
Noah
William
James
Oliver
Benjamin admin
Elijah
Lucas
Mason
Logan
Alexander admin
Ethan
Jacob
Michael
Daniel admin
Henry
Jackson
Sebastian

Don't use switch

Examples:

emacs% java CheckUserName
enter a user name: Liam 
welcome back: Liam 
emacs% java CheckUserName 
enter a user name: liam 
welcome back: liam 
emacs% java CheckUserName 
enter a user name: Oliver 
welcome back: Oliver 
emacs% java CheckUserName 
enter a user name: Benjamin 
welcome back: Benjamin 
you have admin privileges 
emacs% java CheckUserName 
enter a user name: benjamin 
welcome back: benjamin 
you have admin privileges 
emacs% java CheckUserName 
enter a user name: foo 
You are not a recognized user emacs%

I have this for the java code

import java.util.ArrayList;
import java.util.HashSet;
import java.util.Scanner;

public class CheckUserName {

    public static void main(String[] args) {
        //users list
        HashSet<String> users = new HashSet<>();
        users.add("liam");
        users.add("noah");
        users.add("william");
        users.add("james");
        users.add("oliver");
        users.add("elijah");
        users.add("lucas");
        users.add("mason");
        users.add("jacob");
        users.add("logan");
        users.add("ethan");
        users.add("michael");
        users.add("henry");
        users.add("sebastian");
        users.add("jackson");
        //admins list
        HashSet<String> admins = new HashSet<>();
        admins.add("benjamin");
        admins.add("alexander");
        admins.add("daniel");
        Scanner sc = new Scanner(System.in);
        System.out.println("enter a user name: ");
        String name = sc.nextLine();
        //checking in users list
        if (users.contains(name.toLowerCase())) {
            System.out.println("Welcome back " + name);
        }
        //checking in admins list
        else if (admins.contains(name.toLowerCase())) {
            System.out.println("Welcome back " + name);
            System.out.println("you have admin privileges ");
        }

        else System.out.println("You are not a recognized user");
    }
}

but I run it, it says "enter a user name:" your output, "enter a user name: welcome back: sebastian" expected output (error with the different names )

In: Computer Science

C++ exercise ! Change the WEEK‐4 program to work through the GradeBook class. This program has...

C++ exercise ! Change the WEEK‐4 program to work through the GradeBook class.

This program has some functionality that you can use with the Gradebook class.

So, please revise Gradebook class so that the class can use sort() and display() functions of WEEK4 program .

week-4 program :

#include
#include
using namespace std;

void sort(char nm[][10]);
void display(char name[][10]);

int main() {
char names[10][10];
int i;
for (i=0; i<10; i++)
{

cout << "Enter name of the student : ";
cin >> names[i];
}
sort(names);

display(names);

return 0;
}

void sort(char nm[][10]){
char temp[10];
cout <<"Sorting names in Ascending Order " << endl;

for (int i = 0; i <10; ++i)
for (int j =i+1; j<10; j++)
{

if (strcmp(nm[i],nm[j])>0)
{

strcpy(temp,nm[i]);
strcpy(nm[i],nm[j]);
strcpy(nm[j],temp);
}
}

};
void display(char nm[][10]) {


cout <<"Displaying names in Ascending Order " << endl;

for (int i = 0; i <10; ++i)
{
cout<< nm[i] << " " <

}

}

--------------------------------------------------------------------------------

Gradebook class:

#include
#include // program uses C++ standard string class
using namespace std;

// GradeBook class definition
class GradeBook
{
public:

// function that sets the course name
void setCourseName( string name )
{
courseName = name; // store the course name in the object
} // end function setCourseName

// function that gets the course name
string getCourseName() const
{
return courseName; // return the object's courseName
} // end function getCourseName

// function that displays a welcome message
void displayMessage() const
{
// this statement calls getCourseName to get the
// name of the course this GradeBook represents
cout << "Welcome to the grade book for\n" << getCourseName() << "!"
<< endl;
} // end function displayMessage


private:
string courseName; // course name for this GradeBook
}; // end class GradeBook

// function main begins program execution
int main()
{
string nameOfCourse; // string of characters to store the course name
GradeBook myGradeBook; // create a GradeBook object named myGradeBook

// display initial value of courseName
cout << "Initial course name is: " << myGradeBook.getCourseName()
<< endl;

// prompt for, input and set course name
cout << "\nPlease enter the course name:" << endl;
getline( cin, nameOfCourse ); // read a course name with blanks
myGradeBook.setCourseName( nameOfCourse ); // set the course name

cout << endl; // outputs a blank line
myGradeBook.displayMessage(); // display message with new course name
} // end main

In: Computer Science

The equation y(x,t)=Acos2πf(xv−t) may be written as y(x,t)=Acos[2πλ(x−vt)]. Use the last expression for y(x,t) to find...

The equation y(x,t)=Acos2πf(xv−t) may be written as y(x,t)=Acos[2πλ(x−vt)].

Use the last expression for y(x,t) to find an expression for the transverse velocity vy of a particle in the string on which the wave travels. Express your answer in terms of the variables A, v, λ, x, t, and appropriate constants.

Find the maximum speed of a particle of the string. Express your answer in terms of the variables A, v, λ, x, t, and appropriate constants.

In: Physics