Questions
[PYTHON] How do you write a program that first gets a list of floating point numbers...

[PYTHON] How do you write a program that first gets a list of floating point numbers from input. The input begins with an integer indicating the number of numbers that follow. Then input all data values and store them in a list [PYTHON]

In: Computer Science

Starting out with Python 4th edition Chapter 2 Programming Exercise 12 Stock Transaction Program Not sure...

Starting out with Python 4th edition

Chapter 2 Programming Exercise 12 Stock Transaction Program

Not sure how to do this

In: Computer Science

Pseudocode: The first problem has multiple steps but is a little bit easier than the second....

Pseudocode:

  1. The first problem has multiple steps but is a little bit easier than the second.

    1. Define a module main

    2. In main, declare an array of Integers named goldFishPerChild with 4

      elements

    3. Set the values of the array to 6, 4, 3, 3 ( you may do both in 1 line)

    4. You tried to teach them responsibility, but your kids are terrible with

      pets. Each child killed two of its goldfish. This is a learning

      experience for them and for you.

    5. In main, write a loop to update the value of each element so that it is

      2 less ​by using the accumulator pattern​.

  2. Define a function named linearSearchInStringArray

    1. Has String parameter searchTerm : value you are searching for

    2. Has String[] parameter inputArray : array you wish to search through

    3. Has Integer parameter arraySize : number of elements in the array

    4. Returns Boolean : True if search term is one of the values in the

      array, False if not.

    CLUE: use count-controlled loop to iterate through all elements CLUE: needs to use a decision structure each iteration
    CLUE: can simply return True if you find a match!
    CLUE: consider when you know you can return false.

    CLUE: drawing pictures can help

3. Define a function named evenCount

  1. Has Integer[] parameter inputArray : array of elements you are

    counting through

  2. Has Integer parameter arraySize : number of elements in array

  3. Returns Integer : number of elements with even-numbered values in

    array

CLUE: This will require a loop and an extra variable to keep a running total

CLUE: this is a great opportunity to use the "%" operator. Look up "modulus" operator. This operator tells you the 'remainder' of a division operation.

A remainder of 0 means the number can be evenly divided...

In: Computer Science

When an object is falling because of gravity, the following formula can be used to determine...

When an object is falling because of gravity, the following formula can be used to determine the distance the object falls in a specific time period:
d=1/2 gt^2
The variables in the formula are as follows:
d is the distance in meters,
g is 9.8,
t is the amount of time, in seconds, that the object has been falling.
Design a function named calcFallingDistance that accepts an object’s falling time (in seconds) as an argument. The function should return the distance, in meters, that the object has fallen during that time interval.
Design a program that calls the function in a loop that passes the values 1 through 10 as arguments and displays the return value.


In: Computer Science

Do a software evaluation of "MICROSOFT POWERPOINT" using the following criteria: General Requirements and Design Functional...

Do a software evaluation of "MICROSOFT POWERPOINT" using the following criteria:

  1. General Requirements and Design
  2. Functional and Interface Specifications
  3. Conventions
  4. Requirement Traceability
  5. Structures and Interfaces
  6. Logic
  7. Performance
  8. Error Handling and Recovery
  9. Testability and Extensibility
  10. Coupling and Cohesion

In: Computer Science

What do you see as the primary differences between a Web DEVELOPER and a Web DESIGNER?...

What do you see as the primary differences between a Web DEVELOPER and a Web DESIGNER? What are some factors that a Developer must consider over a Designer, or vice versa? Why, specifically, is it important for each to have an understanding of what the other does?

In: Computer Science

Convert this strategy into an algorithm and write it below. remember to provide an algorithm header,...

Convert this strategy into an algorithm and write it below. remember to provide an algorithm header, number the algorithm steps and to use pseudocode conventions.

         Scan the input array A, counting the number of negative, zero and positive numbers. Let these counts be x, y and z respectively.

         Create a new array B of the same size and set a local variable neg to 1, zero to x+1, and pos to x+y+1.

         Scan the input array from left to right, and if the current number being looked at is negative, copy it to B[neg] and increment neg, if it is a zero, copy it to B[zero] and increment zero, and if it is positive, copy it to B[pos] and increment pos.

         Output array B.

In: Computer Science

In the C++ programming language write a program capable of playing Tic-Tac-Toe against the user. Your...

In the C++ programming language write a program capable of playing Tic-Tac-Toe against the user. Your program should use OOP concepts in its design. You can use ASCII art to generate and display the 3x3 playing board. The program should randomly decide who goes first computer or user. Your program should know and inform the user if an illegal move was made (cell already occupied). The program should also announce if one of the players wins or if a draw is achieved. While it is desirable for your program to play a strong game, this is not an Artificial Intelligence course so if your program does not play at a world champion level you will not be penalized for it

In: Computer Science

Need to modify the below code to return the time in minutes instead of seconds. (Using...

Need to modify the below code to return the time in minutes instead of seconds.

(Using Python 2.7.6 )

def numberPossiblePasswords(numDigits, numPossiblePerDigit):
    numPasswords = numPossiblePerDigit**numDigits
    return numPasswords


def maxSecondsToCrack(numPossiblePasswords, secPerAttempt):
    time = numPossiblePasswords*secPerAttempt
    return time


nd = int(input("How many digits long is the passcode? "))      
nc = int(input("How many possible characters are there per digit? "))


secondsPerAttempt = .08


npp = numberPossiblePasswords(nd, nc)


totalSeconds = maxSecondsToCrack(npp, secondsPerAttempt)


print("It will take you " + str(totalSeconds) + " seconds maximum to crack the password.")

In: Computer Science

Python Question I have created a dictionary shown below: import pandas as pd records_dict = {'FirstName':...

Python Question

I have created a dictionary shown below:

import pandas as pd

records_dict = {'FirstName': [
'Jim', 'John', 'Helen'],
'LastName': [
'Robertson', 'Adams', 'Cooper'],
'Zipcode': [
'21801', '22321-1143', 'edskd-2134'],
'Phone': [
'555-555-5555', '4444444444', '323232']
}

I have stored this dictionary in a data frame, like shown below:

records = pd.DataFrame(records_dict)

print(records)

I am able to print the records just fine. My issue is, I want to eliminate, or put a blank space in, the values of the zipcode and phone number keys that do not match the correct format, using regular expressions.

How would I write the syntax for this?   

In: Computer Science

This is a Entry to Java question. Please show me the PseudoCode or Commits first so...

This is a Entry to Java question. Please show me the PseudoCode or Commits first so I can learn to analyze everything a a little bit better.

Simple Calculator (10 points) (General) Calculators represent the most basic, general-purpose of computing machines. Your task is to reduce your highly capable computer down into a simple calculator. You will have to parse a given mathematical expression, and display its result. Your calculator must support addition (+), subtraction (-), multiplication (*), division (/), modulus(%), and exponentiation (**).

Facts

● Mathematical expressions in the form of: num1 operator num2

● Exponentiation should be in the form base ** exponent ○ Example: 3 ** 2 = 9

Input First line is the number of test cases. Each line thereafter is an integer-based mathematical expression in the form defined in the above facts.

Output For each test case, display the result of the mathematical expression terminated with a new line character

Sample Input

4

3+7

5-1

4**2

19/5

Sample Output

10

4

16

3

The main techniques that should be used are selection statements and repetition statements.

In: Computer Science

Code1: #include int main(){     int res1, res2, res;       printf("\nEnter Value of Each Resistance...

Code1:

#include
int main(){
    int res1, res2, res;
  
   printf("\nEnter Value of Each Resistance 1: ");
   scanf("%d", &res1);
   printf("\nEnter Value of Each Resistance 2: ");
   scanf("%d", &res2);
   res = res1+res2;
   printf("\nEquivalent Series Resistance : %d Kohm\n", res);

   return (0);
}

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

Code2:

#include
int main(){
    int res1, res2, res;
  
   printf("\nEnter Value of Each Resistance 1: ");
   scanf("%d", &res1);
   printf("\nEnter Value of Each Resistance 2: ");
   scanf("%d", &res2);
   res = (res1*res2)/(res1+res2);
   printf("\nEquivalent Parellel Resistance : %d Kohm\n", res);

   return (0);
}

Take the two programs and combine them into a single program(using c not c++) that uses an if and else statement to calculate R total either in series or parallel based on the users preference (ask the users which way they want the resistance calculated).

In: Computer Science

(C++) Write a function that takes as an input parameter an integer that will represent the...

(C++) Write a function that takes as an input parameter an integer that will represent the length of the array and a second integer that represents the range of numbers the random number should generate (in other words, if the number is 50, the random number generator should generate numbers between 0 and 49 including 49. The function then sorts the list by traversing the list, locating the smallest number, and printing out that smallest number, then replacing that number in the array with the second parameter +1 (so in our above example, it would be 51. ) Continue to do this until every number in the original array is printed out in order

In: Computer Science

Using Bash script, 1. Print the multiplication table upto 10 rows. Ask the user to enter...

Using Bash script,

1. Print the multiplication table upto 10 rows. Ask the user to enter a number. say user enters 10, your output should be :

[srivatss@athena shell]> ./mult.sh
I will be printing the multiplication table
Please enter a number
10
1 x 10 = 10
2 x 10 = 20
3 x 10 = 30
4 x 10 = 40
5 x 10 = 50

6 x 10 = 60
7 x 10 = 70
8 x 10 = 80
9 x 10 = 90
10 x 10 = 100

[ 5 points ]

2. Create a Simple Calculator [ 20 points , 5 points for each operator]

Ask the user for the first operand, second operand and the operator. You output the result to the user based on the operator. Here is the sample output

[srivatss@athena shell]> ./calc.sh
Welcome to my Simple calculator
Please enter the first operand
2
Please enter the second operand
3
Please enter the operator
+
2 + 3 = 5


[srivatss@athena shell]> ./calc.sh
Welcome to my calculator
Please enter the first operand
4
Please enter the second operand
2
Please enter the operator
-
4 - 2 = 2
[srivatss@athena shell]> ./calc.sh
Welcome to my calculator
Please enter the first operand
4
Please enter the second operand
5
Please enter the operator
*
4 * 5 = 20
[srivatss@athena shell]> ./calc.sh
Welcome to my calculator
Please enter the first operand
6
Please enter the second operand
3
Please enter the operator
/
6 / 3 = 2

3. Using RANDOM function and touch command , create a file with prefix =BatchJob followed by the random number.  

For instance, I ran my script, it created a file with random number 10598.  

[srivatss@athena shell]> ./cmds.sh
BatchJob10598

[ 5 points ]

In: Computer Science

The goal is to design a program that prints out "unlock" when a 3 knock pattern...

The goal is to design a program that prints out "unlock" when a 3 knock pattern is knocked on a sensor. this program will be ran on an arduino with a pizeo sensor.

In: Computer Science