Answer:
Explanation:
The following Java program asks the user for a number to be entered it and uses a while loop to sum up all the numbers from 1 to that one and print it to the console. Then it asks the user for a grade number and prints out the corresponding letter grade for that number.
file = open('text.txt', 'r')
total_rainfall = 0
for line in file:
line = line.replace('\n', '')
info = line.split(' ')
info = [i for i in info if i != '']
print(info[0] + " will have a total of " + info[1] + " inches of rainfall.")
total_rainfall += int(info[1])
average = total_rainfall / 3
print("Average Rainfall will be " + str(average) + " inches")
what can a user modify on a business card using the Edit Business card in the dialog box?
When identifying who will send a presentation, what are the two types of audiences?
Answer:
Explanation:Demographic audience analysis focuses on group memberships of audience members. Another element of audience is psychographic information, which focuses on audience attitudes, beliefs, and values. Situational analysis of the occasion, physical setting, and other factors are also critical to effective audience analysis.
9.19 LAB: Words in a range (lists) Write a program that first reads in the name of an input file, followed by two strings representing the lower and upper bounds of a search range. The file should be read using the file.readlines() method. The input file contains a list of alphabetical, ten-letter strings, each on a separate line. Your program should output all strings from the list that are within that range (inclusive of the bounds). Ex: If the input is:
Answer:
9.2. Métodos del Objeto File (Python para principiantes)
Explanation:
63. Name the 4 main lights & and their primary purpose.
How SPARQL 1.1 has advantage over SPARQL 1.0??
Write a class called MonetaryCoin that is derived from the Coin class presented in Chapter 5 (the source code for Chapter 5 examples is available via Moodle). [6 pts] Store one integer and one float in the MonetaryCoin that represent its value and weight in grams, respectively. Add a third variable of your choice (related to a coin, of course) and use self-descriptive variable names for all three variables. Pass the values to the constructor in MonetaryCoin and save them to your variables.
Answer:
Explanation:
The following Java code creates the MonetaryCoin class that extends the Coin class. It then creates three variables representing the MonetaryCoin object which are its value, weight, and coinYear. These are all passed as arguments to the constructor and saved as instance variables.
public class MonetaryCoin extends Coin {
int value;
float weight;
int coinYear;
public void MonetaryCoin(int value, float weight, int coinYear) {
this.value = value;
this.weight = weight;
this.coinYear = coinYear;
}
}
5. A restore program generally is included with what type of utility?
O A. Screen saver
O B. Antivirus
O C. Uninstaller
D. Backup
6. The interface that allows interaction with menus, and visual images such as
buttons:
A. Touchscreen user interface
O B. Menu driven Interface
O C. Graphical user interface
O D. Command line interface
Please Fix This For Me
print ("Please enter a number between 1 and 100")
n = input
if = n < 1 and n > 100:
if = (n // 2 == 0):
print (n, "is even")
if = (n // 3 == 0):
print (n, "is odd")
else:
print("You have not entered a number between 1 and 100.")
Answer:
The correction is as follows:
n = int(input("Please [tex]enter\ a[/tex] [tex]number\ between\ 1[/tex] and 100: "))
if n < 1 or n > 100:
print("You [tex]have\ not[/tex] entered a [tex]number\ between\ 1[/tex] and 100.")
elif n % 2 == 0:
print (n, "is even")
else:
print (n, "is odd")
Explanation:
See attachment for explanation
You have been given an encrypted copy of the Final exam study guide here, but how do you decrypt and read it???
Along with the encrypted copy, some mysterious person has also given you the following documents:
helloworld.txt -- Maybe this file decrypts to say "Hello world!". Hmmm.
hints.txt -- Seems important.
In a file called pa11.py write a method called decode(inputfile,outputfile). Decode should take two parameters - both of which are strings. The first should be the name of an encoded file (either helloworld.txt or superdupertopsecretstudyguide.txt or yet another file that I might use to test your code). The second should be the name of a file that you will use as an output file. For example:
decode("superDuperTopSecretStudyGuide.txt" , "translatedguide.txt")
Your method should read in the contents of the inputfile and, using the scheme described in the hints.txt file above, decode the hidden message, writing to the outputfile as it goes (or all at once when it is done depending on what you decide to use).
Hint: The penny math lecture is here.
Another hint: Don't forget about while loops...
Mac hint: use encoding="utf-8" in your file open functions, like this:
Mac hint: use encoding="ascii" in your file open functions, like this:
fin = open(input_file,"r",encoding="ascii")
Answer:
You use a decoder
Explanation:
You can find one on an internet browser
how many stages needed to have powerful amplifier?
Power amplifier stages in a real circuit. Circuit diagram of a three stage practical audio power amplifier is shown in the figure below. Small signal transistor Q1 and its associated components form the voltage amplification stage.
Answer:
Generally you should pick an amplifier that can deliver power equal to twice the speaker's program/continuous power rating. This means that a speaker with a “nominal impedance” of 8 ohms and a program rating of 350 watts will require an amplifier that can produce 700 watts into an 8 ohm load.
Create a class called StockTester that has the following fucntionality. a. Create a main method with an ArrayList named dataStock that stores objects of type Stock. b. Add code that reads the content of StockInfo.csv and places it in dataStock. c. Create a new Stock object named newStock using the constructor in Question 1. Set the values to the following. Stock name: Gamma, Stock purchase date: 03/01/20, Number of Shares of Stock: 100, Stock Price: 50.5. Add newStock to dataStock. d. Print the information associated with newStock using printStock. e. Using the method requiredReturn, determine the rate of return required for your stock in Pitsco to have a value of $4,000 in 3 years. Print the result to the screen so that the user can clearly read the result.
Solution :
public class [tex]$\text{Stock}$[/tex] {
private [tex]$\text{String}$[/tex] stockName, [tex]$\text{purchaseDate}$[/tex];
private [tex]$\text{int}$[/tex] nShares;
private [tex]$\text{double}$[/tex] price;
public [tex]$\text{Stock}()$[/tex]
{
this.stockName = "";
this.purchaseDate = "";
this.nShares = 0;
this.price = 0.0;
}
public Stock(String stockName, String purchaseDate, int nShares, double price) {
this.stockName = stockName;
this.purchaseDate = purchaseDate;
this.nShares = nShares;
this.price = price;
}
public String getStockName() {
return stockName;
}
public void setStockName(String stockName) {
this.stockName = stockName;
}
public String getPurchaseDate() {
return purchaseDate;
}
public void setPurchaseDate(String purchaseDate) {
this.purchaseDate = purchaseDate;
}
public int getnShares() {
return nShares;
}
public void setnShares(int nShares) {
this.nShares = nShares;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
public String toString()
{
return("Stock name: " + this.stockName + "\nPurchase date: " + this.purchaseDate
+ "\nNumber of shares of stock: " + this.nShares + "\nPrice: $" + String.format("%,.2f", this.price));
}
public void printStock()
{
System.out.println("Stock name: " + this.stockName + "\nPurchase date: " + this.purchaseDate
+ "\nNumber of shares of stock: " + this.nShares + "\nPrice: $" + String.format("%,.2f", this.price)
+ "\n");
}
}
StockTester.java (Driver class)
import [tex]$\text{java.io.}$[/tex]File;
import [tex]$\text{java.io.}$[/tex]File[tex]$\text{NotFound}$[/tex]Exception;
import [tex]$\text{java.util.}$[/tex]ArrayList;
import [tex]$\text{java.util.}$[/tex]Scanner;
[tex]$\text{public}$[/tex] class StockTester {
private static final String FILENAME = "StockInfo[tex]$.$[/tex]csv";
public static [tex]$\text{void}$[/tex] main([tex]$\text{String}[]$[/tex] args)
{
ArrayList[tex]$<\text{stock}>$[/tex] dataStock = [tex]$\text{readData}$[/tex](FILENAME);
System.out.println("Initial stocks:");
for(Stock s : dataStock)
s.printStock();
System.out.println("Adding a new Stock object to the list..");
Stock newStock = new Stock("Gamma", "03/01/20", 100, 50.5);
dataStock.add(newStock);
System.out.println("\nStocks after adding the new Stock..");
for(Stock s : dataStock)
s.printStock();
Stock targetStock = dataStock.get(3);
double reqReturn = requiredReturn(targetStock, 4000, 3);
System.out.println("Required rate of return = " + String.format("%.2f", reqReturn) + "%");
}
private static ArrayList<Stock> readData(String filename)
{
ArrayList<Stock> stocks = new ArrayList<>();
Scanner fileReader;
try
{
fileReader = new Scanner(new File(filename));
while(fileReader.hasNextLine())
{
String[] data = fileReader.nextLine().trim().split(",");
String stockName = data[0];
String purchaseDate = data[1];
int nShares = Integer.parseInt(data[2]);
double price = Double.parseDouble(data[3]);
stocks.add(new [tex]$\text{Stock}$[/tex](stockName, [tex]$\text{purcahseDate}$[/tex], nShares, price));
}
fileReader.close();
}catch(FileNotFoundException fnfe){
System.out.println(filename + " cannot be found!");
System.exit(0);
}
return stocks;
}
private static double requiredReturn(Stock s, double targetPrice, int years)
{
double reqReturn;
double initialPrice = s.getPrice() * s.getnShares();
reqReturn = ((targetPrice - initialPrice) / initialPrice * years) * 100;
return reqReturn;
}
}
Using a tag, set the color to green for all tags.
Answer:
<style>
p {
background-color: rgb(255, 0, 0);
}
h1 {
background-color: rgb(0, 255, 0);
}
ol {
background-color: rgb(97,51,47);
}
</style>
Explanation:
Put this at the top of your code. It should target the paragraph tag, the header h1 tag, and the Ordered List (OL) tag individually and set their background colors respectively.
It's been a while since I've done CSS so you might have to tweak the syntax a bit, but it should look something like that.
True or false you cannot get a computer virus is you instal antivirus
Answer: F
Explanation: There are many ways hackers can get into your computer, and many ways can bypass an antivirus so it is False
Consider the following method:
public static String joinTogether(int num, String[] arr)
{
String result = "";
for (String x : arr)
{
result = result + x.substring(0, num);
}
return result;
}
The following code appears in another method in the same class:
String[] words = {"dragon", "chicken", "gorilla"};
int number = 4;
System.out.println(joinTogether(number, words));
What is printed when the code above is executed?
a. dragonchickengorilla
b. drachigor
c. dragchicgori
d. dragochickgoril
e. There is an error in the program, it does not run
Answer: b.
Explanation:
Which element adjusts the space around the data in each cell of a table? adjusts the space around the data in each cell of a table.
Answer:
Increase/decrease indentation
Explanation:
Answer:
(Cellpadding) is actually the correct answer.
Explanation:
Cellpadding and cellspacing are two important features of an HTML table. Cellpadding sets the space around the data in each cell. Cellspacing sets the space around each cell in the table.
3) Many people use the World Wide Web (Web) regularly, and search engines
provide vital access to Web resources. Textual and multimedia content is
accessible via web search engines. Informational, navigational, and
transactional intent are the three types of user intent classified for Web
searching. What is meant by navigational, informational, and transactional
search? Provide a comprehensive explanation with examples for each.
Answer: See explanation
Explanation:
Navigational search - This occurs when the user is looking for a certain website. Then the name of the website will be entered into the search bar.
Informational search - This occurs when the user wants to get a certain information. For example, if user enters "what is computer" into the search bar, different results relating to the word "computer" will be gotten.
Transactional search - This occurs when the user wants a website that is interactive it which possess more interaction. An example is when the user wants to buying something, register for something or maybe download something
Which of the following is not part of the four ways you can avoid problems with email communication?
a.
Be brief.
b.
Proofread your message.
C.
Reply right away after you get an email.
d.
Seek other ways to relay your message
Answer:
d is the correct answer for this problem