Questions
Write a python program to display a menu with the following options: (1) add, (2) subtract,...

Write a python program to display a menu with the following options: (1) add, (2) subtract, (3) multiply, (4) divide (5) mod, and (6) do nothing. I

f the user enters something else (except 1-6), the program should display an error message.

Otherwise, it should ask the user for two numbers, perform the calculation, and display the result.

In: Computer Science

In Java Problem 1 Create an Array of your top four vacation spots. Print the first...

In Java

Problem 1
Create an Array of your top four vacation spots. Print the first spot and the last spot in your array.

Problem 2
Create an Array to hold the names of 5 people. Print the first letter of each of their names.

Problem 3
Create a mini console game that asks for the number of words you want to enter into an Array. Enter each word and then a letter. Print out feedback that says "Yep its got one of those" or "Sorry that letter is not in the word" depending on whether on not the word entered contains the letter specified.

Stretch Task (Optional)
Create a String representing a list of things that uses some delimiter (commas,dashes, etc) Split that String into an Array of Strings, then print each of the Array Elements. You will need to research (How to Split a String using a Delimiter).

In: Computer Science

Write a Java program in Eclipse to calculate the total cost to enter into a waterpark...

Write a Java program in Eclipse to calculate the total cost to enter into a waterpark for a family/group

Ticket rates are listed below

kids (Age 12 and under)=$ 12.50

Regular( Age between12 -55) =$ 18.25

Seniors (55 and above) = $15.00

Tax =7%

Your program should ask the user to enter the total number of members in their group.

User needs to enter the ages for all members. Write appropriate error messages for invalid entries.

An array should be used to store the ages of the family members.

Based on the age it has to calculate the cost of each member and calculate the total cost including tax.

Your program should display

The number of tickets for each type

And the total cost for the group

After display your program should repeat the process until the user wants to stop.

Your program must use

  1. Array
  2. Do while Loop
  3. Constant variable
  4. Atleast one method

Sample run of the program:

Welcome to our WATERPARK!!!

Please enter the number of members in your group.   7

Please enter the ages for each person in your group. 15 28 11 34 26 60 58

Please pay the total of $115.50 + 7% tax = $ 123.59

And pick up

1 Kid ticket

4 Regular tickets and

2 Senior tickets

Please Press a positive number for next customer, Negative number to end. 5

Welcome to our WATERPARK!!!

Please enter the number of members in your group.  

In: Computer Science

Program 3: Give a baby $5,000!  Did you know that, over the last century, the stock market...

Program 3: Give a baby $5,000!  Did you know that, over the last century, the stock market has returned an average of 10%?  You may not care, but you’d better pay attention to this one.  If you were to give a newborn baby $5000, put that money in the stock market and NOT add any additional money per year, that money would grow to over $2.9 million by the time that baby is ready for retirement (67 years)!  Don’t believe us?  Check out the compound interest calculator from MoneyChimp and plug in the numbers!

To keep things simple, we’ll calculate interest in a simple way.  You take the original amount (called the principle) and add back in a percentage rate of growth (called the interest rate) at the end of the year.  For example, if we had $1,000 as our principle and had a 10% rate of growth, the next year we would have $1,100.  The year after that, we would have $1,210 (or $1,100 plus 10% of $1,100).  However, we usually add in additional money each year which, for simplicity, is included before calculating the interest.

Your task is to design (pseudocode) and implement (source) for a program that 1) reads in the principle, additional annual money, years to grow, and interest rate from the user, and 2) print out how much money they have each year.  Task 3: think about when you earn the most money! Lesson learned: whether it’s your code or your money, save early and save often…

Sample run 1:

Enter the principle: 2000

Enter the annual addition: 300

Enter the number of years to grow: 10

Enter the interest rate as a percentage: 10

Year 0: $2000

Year 1: $2530

Year 2: $3113

Year 3: $3754.3

Year 4: $4459.73

Year 5: $5235.7

Year 6: $6089.27

Year 7: $7028.2

Year 8: $8061.02

Year 9: $9197.12

Year 10: $10446.8

Sample run 2 (yeah, that’s $9.4MM):

Enter the principle: 5000

Enter the annual addition: 1000

Enter the number of years to grow: 67

Enter the interest rate as a percentage: 10

Year 0: $5000

Year 1: $6600

Year 2: $8360

Year 3: $10296

Year 4: $12425.6

Year 5: $14768.2

.

.

Year 59: $4.41782e+06

Year 60: $4.86071e+06

Year 61: $5.34788e+06

Year 62: $5.88376e+06

Year 63: $6.47324e+06

Year 64: $7.12167e+06

Year 65: $7.83493e+06

Year 66: $8.61952e+06

Year 67: $9.48258e+06

////////////( PLEASE WRITE IN PSEUDOCODE )/////////////////

In: Computer Science

C++ Parse text (with delimiter) read from file. If a Text file has input formatted such...

C++ Parse text (with delimiter) read from file.

If a Text file has input formatted such as: "name,23" on every line where a comma is the delimiter, how would I separate the string "name" and integer "23" and set them to separate variables for every input of the text file? I am trying to set a name and age to an object and insert it into a vector.

#include <iostream>
#include <vector>
#include <fstream>
using namespace std;

class Student{
    public:
        string name;
        int age;
};

int main() {


    vector <Student>studentVector;
    Student s;
    string student_name;
    int student_age;
  
    ifstream myFile("file.txt");
      
    while(myFile>> student_name >> student_age){


        //s.name is assigning the entire line of unparsed text
        s.name = student_name;

       ///age is not read because input string from file is not parsed

        s.age = student_age;


        studentVector.push_back(s);
    }


    return 0;
}

In: Computer Science

6. Compute the frame check sequence using Cyclic Redundancy Check (CRC) for the following information: Message...

6. Compute the frame check sequence using Cyclic Redundancy Check (CRC) for the following information:
Message = 111010110, Pattern = 101110

In: Computer Science

Code: please use in visual studio 2019 c++ (not java) In total you will write 6...

Code: please use in visual studio 2019 c++ (not java)

In total you will write 6 functions:

Functions :

A ) addInts, returns int; input is two ints; Add the values of the two parameters and return the sum

B) subInts , returns int; input is two ints; Subtract the values of the two parameters and return the difference

C) multInts, returns int; input is two ints; multiple the values of the two parameters and return the product

D) divInts, returns int; input is two ints; Divide the values of the two parameters and return the quotient

E) modInts, returns int; input is two ints; compute the residual of the values of the two parameters and return the residual

F) A function called computeOperation ( ) that , returns an int; input is three parameters: one 'control' int, and two ints;  

if the control int ( the first parameter) is :

Control

Control Parameter compute return value :
1 Return sum of 2nd and 3td parameters
2 Return diff of 2nd and 3td parameters
3 Return product of 2nd and 3td parameters
4 Return quotient of 2nd and 3td parameters
5 Return modulus of 2nd and 3td parameters

expect to see both Function Declarations and of course the Function Definitions for all 6 functions

expect to see some obvious test code or data sets.  

expect to see a switch statement not a series of if statements if it is appropriate.

To Be Clear:

in the main function there should be a homework header and then a bunch of 'call's to the

computeOperation ( ) function.  

And

computeOperation should then have code to invoke one of the 5 low level compute functions. The value that is returned should be returned by computeOperator.

In: Computer Science

Find the statistics for a single quantitative variable by utilizing Encapsulation and Namespace functions: Each function...

Find the statistics for a single quantitative variable by utilizing Encapsulation and Namespace functions:

Each function should accept a list as an input parameter:

List = [1,2,3,4,5,6]

Functions : lst_min, lst_max, lst_range, lst_variance, lst_stdev.

Use: Python programming language, please. (Note: without inbuilt function)

Thank you.

In: Computer Science

Are Gradient boosting model, Random Forest, XGBoost, and LightGBM all tree-based models?? Thanks!

Are Gradient boosting model, Random Forest, XGBoost, and LightGBM all tree-based models??

Thanks!

In: Computer Science

Code in C++ Learning Outcomes Implement two stacks and use them to implement an infix to...

Code in C++

Learning Outcomes

Implement two stacks and use them to implement an infix to prefix expression convertor

Stacks

A stack is an abstract data type which uses a sequential container and limits access to that container to one end. You may enter or remove from the container, but only at one end. Using the Linked List data structure from your last homework assignment, implement a Stack of type string.

The Stack should only have one data member: the Linked List. It should implement the following methods:

  • Stack(): Empty constructor.
  • void clear(): removes all of the elements from the stack
  • int size() const: returns the number of elements in the stack
  • bool isEmpty() const: returns true if the stack is empty, false otherwise
  • string top() const: returns the top of the stack. It must throw an error if the stack is empty.
  • string pop(): returns the top of the stack and removes it. It must throw an error if the stack is empty.
  • void push(string): adds a value of type string to the stack.

Your linked list should support adding to the end of the list.

Infix to Prefix Conversion

Suppose you have an infix expression a+c^d/g-h. Using the math operation priority, we learned this is equal to a+(((c^d)/g)-h).

The prefix expression of the above infix one is:   + a - / ^ c d g h

Your program must read a math expression in string and prints its prefix equivalent.

An example of program run:

Please enter the infix math Expression: a+c^d/g-h

The equivalent prefix math expression is : + a - / ^ c d g h

Do you want to add another expression [Y/N]: Y

Another example of the program in which program returns an error message.

Please enter the infix math Expression: a++c^d/g-h

Sorry! The expression is not valid.

Do you want to add another expression [Y/N]: Y

The user must use * to declare the multiplication, and ^ to declare power.

The only valid operators are: ^ * / + -

User may enter ( and ) as many as they want provided the expression is correct. For example, the following expression is valid:

(((((((a+b)))))))+((((c))))

And the output must be: + + a b c

Program must treat variables such as ab as one operand and not the multiplication of a and b. (ab!=a*b)

See following example:

Please enter the infix math Expression: aa+c^dsa/gl-h

The equivalent prefix math expression is : + aa - / ^ c dsa g h

The aa and dsa are two operands.

Rules for Implementation

Start at the beginning of the expression string and evaluate each character based on these rules.

  • You need two stacks. One is used to store the operators. The second one is used to store the operands. Be cautious that the operand stack not only stores the single operands such as a, b, cd but also combined operands. For example, in expression

a+b*c the b and c are the operands of the * operator. Then * b c all together is an operand to the + operator (the other operand of this operator is a)

  • Checking the priority is the key in this assignment. Whenever you want to insert a new operator you should check the top of the operator stack. If the top one has a higher or equal priority you need to calculate the prefix one and then insert the new operator (look at the example I wrote for you.)

After all characters have been evaluated, perform one last check:

  • If the operator stack is empty and operand stack has more than one item the expression is not valid.
  • The final expression in the operand stack is the answer.

The InfixToPrefix Class

Create a new class called InfixToPrefix.hpp containing the following fields.

  • std::string mExpression;
  • Stack operator;
  • Stack operand;

It will also have the following constructors and methods.

  • A constructor which passes the expression in one string
  • string toPrefix(): A method which evaluates the stored expression and returns the prefix expression.

Write the Driver.

The program will begin with a single prompt: " Please enter the infix math Expression: "

The user will supply an expression. Next, the program will prints the prefix expression of the given expression. If the expression is not valid, report print that the expression is not a valid infix expression. Finally, the program will wait for a final keystroke (i.e. pause). Make sure that your program works for all of the sample expressions.

In: Computer Science

a. Encoding the decimal number 2.25 into an 8-bit binary. Suppose k=4 exponent bits, n=3 fraction...

a. Encoding the decimal number 2.25 into an 8-bit binary. Suppose k=4 exponent bits, n=3 fraction bits, and the bias is 7. What’s the corresponding binary representation for 2.25? Show your work. b. What’s the value in decimal if this is an 8-bit floating point number? Suppose k=4 exponent bits, n=3 fraction bits, and the bias is 7 of 10111001

In: Computer Science

Submit a topic for your Security paper. Pick a topic for a 5-6 page paper on...

Submit a topic for your Security paper.
Pick a topic for a 5-6 page paper on any topic in information security. Submit your topic paper . GIAC Gold standards paper guidelines should be followed along with standard APA Style
Title page, abstract and reference pages are not included in the page count.

should be a narrow topic i already submitted 2 topics but got rejected this hoping ill get answer from you

topic need to be from information security and should be a narrow topic it may be any topic related to subject

topic aswell as the description because topic im selecting getting rejected

In: Computer Science

1. Convert the binary data “110101” into analog waveforms using following modulation techniques: a. Two level...

1. Convert the binary data “110101” into analog waveforms using following modulation techniques: a. Two level Amplitude Shift Keying b. Two level Frequency Shift Keying c. Two level Phase Shift Keying d. Differential Phase shift keying e. Four level Amplitude Shift Keying f. Four level Phase Shift Keying g. Eight level Amplitude Shift Keying

In: Computer Science

Discuss DLP and methods companies can use to prevent it.

Discuss DLP and methods companies can use to prevent it.

In: Computer Science

Using Python: The Fibonacci sequence is a famous series of numbers with the following rules: The...

Using Python:

The Fibonacci sequence is a famous series of numbers with the following rules:

The first number in the sequence is 0 -

The second number in the sequence is 1 -

The other numbers in the sequence are composed by adding up the two previous numbers in the sequence. We therefore have the following sequence: 1 st number: 0 2nd number: 1 3 rd number: 0 + 1 = 1 4 th number: 1+1 =2 5 th number: 2+1 = 3 6 th number: 3 + 2 = 5 7 th number: 5 + 3 = 8 and so on….

a. Write a program that takes a value n from the user and , using recursive function, display the first n Fibonacci numbers. (3pts)

b. Then, using List Comprehension, indicate which of the first n Fibonacci numbers are (2pts) : - odd numbers - multiples of 5

Example: How many Fibonacci numbers do you want ? 2 The first Fibonacci numbers are : [0, 1] From this list, the odd numbers are : [1] There is no multiples of 5 in this list How many Fibonacci numbers do you want ? 5 The first Fibonacci numbers are : [0, 1, 1, 2, 3] From this list, the odd numbers are : [1, 1, 3] There is no multiples of 5 in this list How many Fibonacci numbers do you want ? 11 The first Fibonacci numbers are: [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55] From this list, the odd numbers are : [1, 1, 3, 5, 13, 21, 55] From this list, the multiples of 5 are : [5, 55] Note that 0 is neither an odd number nor multiple of 5

In: Computer Science