C++
Write a program that produces the truth table of the following logical operators. You aresupposed to output one table with all the operators (one column for each operator). Write theheader of the table - this is the name of the columns-. Output the result on the file prog1 output.txt. The table should contain the letters T and F, it should NOT print 1s and 0s. Show theresults on the following order:
1. negation (!)
2. disjunction (AND operator, &)
3. conjunction (OR operator, |)
4. exclusive or (or but not both, ^)
5. implication (CONDITIONAL operator, ->)
6. biconditional (<->)
In: Computer Science
In java
Modify your finished guessNumber.java program to include a random number generator to generate the guessed number (from 1 to 10). use the Random class to generate a random number between a range of integers. In your program include an if … then statement to check if the number you entered is bigger or smaller than the guessed number, and display a message. Also included is a counter to keep track on how many times the user has guessed, and display it at then end.
Below is the java code that needs to be modified:
/* Week3 in-class exercise
Name: numberGuess.java
Author: Your Name
Date:
*/
// need the Scanner class to get user input
import java.util.Scanner;
public class numberGuess {
/**
* @param args
*/
public static void main(String[] args) {
// TODO:
//
// a. declare a final int, and assign a value of 6 as the guessed
number
final int
guessed_number = 6;
// b. create a Scanner to get user input
Scanner input =
new Scanner(System.in);
// c. use a do {} while loop to prompt the user to enter an integer
between 1 and 10,
// assign the user input to an int, and compare to the guessing
number
int userInput =
0;
do{
System.out.println("Please enter an integer between 1 and
10.");
userInput = input.nextInt();
} while (userInput != guessed_number);
// d. if the number matches the guessed number,
// print out a message that the number entered is correct.
System.out.println("\nNice! You entered the correct
number.\n");
// Here is to print your name
System.out.println("Author: Your Name");
}
}
In: Computer Science
QUESTION 16
Three years ago, JKL Co. issued bonds with a 11-year maturity then and at a coupon rate of 7.9 percent. The bonds make semiannual payments. If the YTM on these bonds is 8.6 percent, what is the current bond price? (Do not include the dollar sign ($). Enter rounded answer as directed, but do not use the rounded numbers in intermediate calculations. Round your answer to 2 decimal places (e.g., 32.16).)
QUESTION 18
Bond RTY.AF has a 5 percent coupon, makes semiannual payments, currently has 18 years remaining to maturity, and is currently priced at par value. If interest rates suddenly rise by 2 percent, what is the percentage change in the price of Bond RTY.AF? Be sure to include the sign, especially if the bond price falls and the percentage change is negative. (Do not include the percent sign (%). Enter rounded answer as directed, but do not use the rounded numbers in intermediate calculations. Round your answer to 2 decimal places (e.g., 32.16).)
In: Finance
Consultative leadership 1. Do you engage your team or co-worker’s in the decision-making process? 2. List and describe three things that I can do to improve my listening skills? 3. What areas or situation have I been able to effectively advise or counsel a co-worker? How was my advice received?
In: Operations Management
Knowledge, skill, experience
Instructions: answer the questions below based on your experience in one of the following situations: (1)
a team lead, (2) a manager or supervisor, or (3) a member of a team.
(internal or external customers)?
satisfaction or job promotion?
Immediately (30 days) Longer-range ( 6 months to 1 year)
1.
2.
3.
4.
In: Operations Management
respond to the summaries posted please
Methods for Reliable Data Transfers
In: Computer Science
COPIED Question>
" Fitzgerald Law, LLP, a local attorney's firm, has contacted you as they have heard good things about your network design skills. They currently have a wireless network set up for the law firm but would like to allow clients and internal staff to browse the web while they are visiting the firm. They are worried, however, about the security considerations that go with this extension of their network.
Fitzgerald Law has requested that you send them your ideas and recommendations in memo form on how to create one overall network that incorporates the two wireless networks (the protected law firm network and the unprotected public network). They would like to see a diagram of the entire network, costs, and how long it would take to implement. Lastly, they would like to have you give them ideas of how you will make sure this network is secure, outlining what tools you may use to make it so. Answer all of Fitzgerald Law's questions, including a diagram. You can create the diagram. "
In: Computer Science
Discuss the limitations and strengths of a wide area network. What are some of the security challenges presented by the increased growth in wireless networking for any organization or individual today?
In: Computer Science
1. In Raptor, Prompt for and input a saleswoman’s sales for the month (in dollars) and her commission rate (as a percentage). Output her commission for that month. Note that you will need to convert the percentage to a decimal. You will need the following variables: SalesAmount CommissionRate CommissionEarned You will need the following formula: CommissionEarned = SalesAmount * (CommissionRate/100).
In: Computer Science
(+30) Write a python program that generates four random between -50 and +50 using python’s random number generator (RNG) see the following code (modify as needed )
import random
a = 10 # FIX
b =100 # FIX
x = random.randint(a,b) # (1) returns an integer a <= x
<= b
# modify a and b according to the lab
requirement
print('random integer == ', x)
and displays
EXAMPLE OUTPUT
If the RNG generated the four integers 22 -8 17 -5 then display
In: Computer Science
Which of the following is most likely to shift the demand curve for electricity to the left?
a. |
consumers becoming more energy conscious. |
|
b. |
an increase in income. |
|
c. |
a decrease in the price of electricity. |
|
d. |
an increase in the price of natural gas, a substitute source of energy. |
Sugar and honey are viewed as substitutes for each other in many cooking applications. If the price of sugar rises, we would expect the:
a. |
demand for honey to increase. |
|
b. |
demand for honey to decrease. |
|
c. |
quantity demanded of honey to decrease. |
|
d. |
price of honey to decrease. |
The long-run equilibrium condition for perfect competition is:
a. |
P = AVC = MR = MC. |
|
b. |
P = ATC = MR = MC. |
|
c. |
Q = AVC = MR = MC. |
|
d. |
Q = ATC = MR = MC. |
Exhibit 4-11 Data on supply and
demand
|
In Exhibit 4-11, the equilibrium price per bushel of wheat is:
|
In: Economics
use *python
Though CPUs, and computer hardware in-general, are not the main focus of this course, it can be useful to know a thing or two about computer hardware. The CPU (Central Processing Unit) is generally the piece of hardware that carries out the instructions of the python programs that you run in this class.
In this short PA, you will write a program that takes a few input values related to CPU performance. The program should determine whether or not the specified CPU is within one of four categories: high-performance, medium-performance, low-performance, and in need of an upgrade. Name the file cpu.py. Shown below is an example of the program prompting the user for three inputs, and then printing out the corresponding CPU performance category:
Press ENTER or type command to continue Enter CPU gigahertz: 2.7 Enter CPU core count: 2 Enter CPU hyperthreading (True or False): False That is a low-performance CPU
The program should spit out one of 4 strings:
How you determine which to print out should be based on the below tables:
If the CPU has hyperthreading
performance level | min GHz | min cores |
high-performance | 2.7 | 6 |
medium-performance | 2.4 | 4 |
low-performance | 1.9 | 2 |
If the CPU does not have hyperthreading
performance level | min GHz | min cores |
high-performance | 3.2 | 8 |
medium-performance | 2.8 | 6 |
low-performance | 2.4 | 2 |
There’s also one “special-case” rule: If a CPU has 20 or more cores, regardless of the other stats, it should be considered high-performance.
Examples
Below are several examples of program runs. There will be more tests on Gradescope.
Enter CPU gigahertz: 2.0 Enter CPU core count: 8 Enter CPU hyperthreading (True or False): True That is a low-performance CPU.
Enter CPU gigahertz: 4.0 Enter CPU core count: 6 Enter CPU hyperthreading (True or False): False That is a medium-performance CPU.
In: Computer Science
Trust-based relationships Instructions: answer the questions below based on your perspective from Part Two. 1. What is the status of my relationships with key project team members and customers? List one key project team member and one customer (internal or external customer) and discuss the nature and state of the relationships. 2. Which relationships cause me the most pain (friction, confrontation, dishonesty, etc.)? List the relationships and pain points. 3. Which specific actions can I take to turn the troubled relationships into positive, healthy relationships?
In: Operations Management
Implement the following functions. Each function deals with null terminated C-strings. You can assume that any char array passed into the functions will contain valid, null-terminated data. Your functions must have the signatures listed below.
1. This function returns the last index where the target char can be found in the string. it returns -1 if the target char does not appear in the string. For example, if s is “Giants” and target is ‘a’ the function returns 2.
int lastIndexOf(char *s, char target)
2. This function alters any string that is passed in. It should reverse the string. If “flower” gets passed in it should be reversed in place to “rewolf”. To be clear, just printing out the string in reverse order is insufficient to receive credit, you must change the actual string to be in reverse order.
void reverse(char *s)
3. This function finds all instances of the char ‘target’ in the string and replaces them with ‘replacementChar’. It also returns the number of replacements that it makes. If the target char does not appear in the string it returns 0 and does not change the string. For example, if s is “go giants”, target is ‘g’, and replacement is ‘G’, the function should change s to “Go Giants” and return 2.
int replace(char *s, char target, char replacementChar)
4. This function returns the index in string s where the substring can first be found. For example if s is “Skyscraper” and substring is “ysc” the function would return 2. It should return -1 if the substring does not appear in the string.
int findSubstring(char *s, char substring[])
5. This function returns true if the argument string is a palindrome. It returns false if it is not. A palindrome is a string that is spelled the same as its reverse. For example “abba” is a palindrome. So is “hannah”, “abc cba”, and “radar”.
bool isPalindrome(char *s)
Note: do not get confused by white space characters. They should not get any special treatment. “abc ba” is not a palindrome. It is not identical to its reverse.
6.This function should reverse the words in a string. Without using a second array. A word can be considered to be any characters, including punctuation, separated by spaces (only spaces, not tabs, \n etc.). So, for example, if s is “The Giants won the Pennant!” the function should change s to “Pennant! the won Giants The”.
void reverseWords(char *s)
Requirements
- You may use strlen(), strcmp(), and strncpy() if you wish, but you may not use any of the other C-string library functions such as strstr(), strncat(), etc.
- You will not receive credit for solutions which use C++ string objects, you must use C-Strings (null-terminated arrays of chars) for this assignment.
In: Computer Science
I have an excel file imported into canopy (python) using import pandas as pd. The excel file has headers titled:
datetime | created_at | PM25 | temperatureF | dewpointF | humidityPCNT | windMPH | wind_speedMPH | wind_gustsMPH | pressureIN | precipIN |
these column headers all have thousands of data numbers under them. How could i find the average of all of the numbers in each column and plot them on 1 graph (line graph or scatter plot) Thank you.(please comment out your code)
In: Computer Science