Answer:
Explanation:
suna shahani kesa a ..
Write an application that combines several classes and interfaces.
Answer:
Explanation:
The following program is written in Java and it combines several classes and an interface in order to save different pet objects and their needed methods and specifications.
import java.util.Scanner;
interface Animal {
void animalSound(String sound);
void sleep(int time);
}
public class PetInformation {
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
String petName, dogName;
String dogBreed = "null";
int petAge, dogAge;
Pet myPet = new Pet();
System.out.println("Enter Pet Name:");
petName = scnr.nextLine();
System.out.println("Enter Pet Age:");
petAge = scnr.nextInt();
Dog myDog = new Dog();
System.out.println("Enter Dog Name:");
dogName = scnr.next();
System.out.println("Enter Dog Age:");
dogAge = scnr.nextInt();
scnr.nextLine();
System.out.println("Enter Dog Breed:");
dogBreed = scnr.nextLine();
System.out.println(" ");
myPet.setName(petName);
myPet.setAge(petAge);
myPet.printInfo();
myDog.setName(dogName);
myDog.setAge(dogAge);
myDog.setBreed(dogBreed);
myDog.printInfo();
System.out.println(" Breed: " + myDog.getBreed());
}
}
class Pet implements Animal{
protected String petName;
protected int petAge;
public void setName(String userName) {
petName = userName;
}
public String getName() {
return petName;
}
public void setAge(int userAge) {
petAge = userAge;
}
public int getAge() {
return petAge;
}
public void printInfo() {
System.out.println("Pet Information: ");
System.out.println(" Name: " + petName);
System.out.println(" Age: " + petAge);
}
//The at (email symbol) goes before the Override keyword, Brainly detects it as a swearword and wont allow it
Override
public void animalSound(String sound) {
System.out.println(this.petName + " says: " + sound);
}
//The at (email symbol) goes before the Override keyword, Brainly detects it as a swearword and wont allow it
Override
public void sleep(int time) {
System.out.println(this.petName + " sleeps for " + time + "minutes");
}
}
class Dog extends Pet {
private String dogBreed;
public void setBreed(String userBreed) {
dogBreed = userBreed;
}
public String getBreed() {
return dogBreed;
}
}
If you want to continue working on your web page the next day, what should you do?
a. Create a copy of the file and make changes in that new copy
b. Start over from scratch with a new file
c. Once a file has been saved, you cannot change it
d. Reopen the file in your text editor to
Answer:
d. Reopen the file in your text editor
Answer:
eeeeeeeee
Explanation:
Which of the following are complete sets of data and are the rows of the table?
Files
Fields
Queries
Records
Answer:
I think the answer is going to be records
I want to know the basic of Excel
Answer:
Use Pivot Tables to recognize and make sense of data.
Add more than one row or column.
Use filters to simplify your data.
Remove duplicate data points or sets.
Transpose rows into columns.
Split up text information between columns.
Use these formulas for simple calculations.
Get the average of numbers in your cells.
Parts of a computer software
Answer:
I think application software
utility software
networking software
You are responsible for a rail convoy of goods consisting of several boxcars. You start the train and after a few minutes you realize that some boxcars are overloaded and weigh too heavily on the rails while others are dangerously light. So you decide to stop the train and spread the weight more evenly so that all the boxcars have exactly the same weight (without changing the total weight). For that you write a program which helps you in the distribution of the weight.
Your program should first read the number of cars to be weighed (integer) followed by the weights of the cars (doubles). Then your program should calculate and display how much weight to add or subtract from each car such that every car has the same weight. The total weight of all of the cars should not change. These additions and subtractions of weights should be displayed with one decimal place. You may assume that there are no more than 50 boxcars.
Example 1
In this example, there are 5 boxcars with different weights summing to 110.0. The ouput shows that we are modifying all the boxcars so that they each carry a weight of 22.0 (which makes a total of 110.0 for the entire train). So we remove 18.0 for the first boxcar, we add 10.0 for the second, we add 2.0 for the third, etc.
Input
5
40.0
12.0
20.0
5. 33.
0
Output
- 18.0
10.0
2.0
17.0
-11.0
Answer:
The program in C++ is as follows:
#include <iostream>
#include <iomanip>
using namespace std;
int main(){
int cars;
cin>>cars;
double weights[cars];
double total = 0;
for(int i = 0; i<cars;i++){
cin>>weights[i];
total+=weights[i]; }
double avg = total/cars;
for(int i = 0; i<cars;i++){
cout<<fixed<<setprecision(1)<<avg-weights[i]<<endl; }
return 0;
}
Explanation:
This declares the number of cars as integers
int cars;
This gets input for the number of cars
cin>>cars;
This declares the weight of the cars as an array of double datatype
double weights[cars];
This initializes the total weights to 0
double total = 0;
This iterates through the number of cars
for(int i = 0; i<cars;i++){
This gets input for each weight
cin>>weights[i];
This adds up the total weight
total+=weights[i]; }
This calculates the average weights
double avg = total/cars;
This iterates through the number of cars
for(int i = 0; i<cars;i++){
This prints how much weight to be added or subtracted
cout<<fixed<<setprecision(1)<<avg-weights[i]<<endl; }
The city of Green Acres is holding an election for mayor. City officials have decided to automate the process of tabulating election returns and have hired your company to develop a piece of software to monitor this process. The city is divided into five precincts. On election day, voters go to their assigned precinct and cast their ballots. All votes cast in a precinct are stored in a data file that is transmitted to a central location for tabulation.
Required:
Develop a program to count the incoming votes at election central.
Answer:
Explanation:
The following program asks the user to enter the precinct number and then loops to add votes until no more votes need to be added. Then it breaks the loop and creates a file called results to save all of the results for that precinct.
precinct = input("Enter Precinct Number: ")
option1 = 0
option2 = 0
while True:
choice = input("Enter your vote 1 or 2: ")
if int(choice) == 1:
option1 += 1
else:
option2 += 1
endVote = input("Vote again y/n")
if endVote.lower() != 'y':
break
f = open("results.txt", "w")
f.write("Precinct " + precinct + ": \nOption 1: " + str(option1) + "\nOption 2: " + str(option2))
Write a Python class that inputs a polynomial in standard algebraic notation and outputs the first derivative of that polynomial. Both the inputted polynomial and its derivative should be represented as strings.
Answer:Python code: This will work for equations that have "+" symbol .If you want to change the code to work for "-" also then change the code accordingly. import re def readEquation(eq): terms = eq.s
Explanation:
4 reasons why users attach speakers
to their computers
Answer: we connected speakers with computers for listening voices or sound because the computer has not their own speaker. the purpose of speakers is to produce audio output that can be heard by the listener. Speakers are transducers that convert electromagnetic waves into sound waves. The speakers receive audio input from a device such as a computer or an audio receiver.
Explanation: Hope this helps!
What are some examples and non-examples of digital security?
Answer:
Devices such as a smart card-based USB token, the SIM card in your cell phone, the secure chip in your contactless payment card or an ePassport are digital security devices
HURRY- I’ll give 15 points and brainliest answer!!
How do you insert text into a presentation??
By selecting text from the insert menu
By clicking in the task pane and entering text
By clicking in a placeholder and entering text
By drawing a text box clicking in it and entering text
(This answer is multiple select)
Answer:
the last one the drawing thingy:)))
your computer has been running slowly and you suspect it because its is low on memory. you review the hardware configuration and find that computer has only 4gb of ram. how can you determine how much memory your computer should have to run properly?
You will write code to manipulate strings using pointers but without using the string handling functions in string.h. Do not include string.h in your code. You will not get any points unless you use pointers throughout both parts.
You will read in two strings from a file cp4in_1.txt at a time (there will be 2n strings, and you will read them until EOF) and then do the following. You alternately take characters from the two strings and string them together and create a new string which you will store in a new string variable. You may assume that each string is no more than 20 characters long (not including the null terminator), but can be far less. You must use pointers. You may store each string in an array, but are not allowed to treat the string as a character array in the sense that you may not have statements like c[i] = a[i], but rather *c *a is allowed. You will not get any points unless you use pointers.
Example:
Input file output file
ABCDE APBQCRDSETFG
PQRSTFG arrow abcdefghijklmnopgrstuvwxyz
acegikmoqsuwyz
bdfhjlnprtvx
Solution :
#include [tex]$< \text{stdio.h} >$[/tex]
#include [tex]$< \text{stdlib.h} >$[/tex]
int [tex]$\text{main}()$[/tex]
{
[tex]$\text{FILE}$[/tex] *fp;
[tex]$\text{fp}$[/tex]=fopen("cp4in_1.txt","r");
char ch;
//while(1)
//{
while(!feof(fp))
{
char *[tex]$\text{s1}$[/tex],*[tex]$\text{s2}$[/tex],*[tex]$\text{s3}$[/tex];
[tex]$\text{s1}$[/tex] = (char*) [tex]$\text{malloc}$[/tex]([tex]$20$[/tex] * [tex]$\text{sizeof}$[/tex](char));
[tex]$\text{s2}$[/tex] = (char*) [tex]$\text{malloc}$[/tex]([tex]$20$[/tex] * [tex]$\text{sizeof}$[/tex](char));
[tex]$\text{s3}$[/tex] = (char*) [tex]$\text{malloc}$[/tex]([tex]$40$[/tex] * [tex]$\text{sizeof}$[/tex](char));
[tex]$\text{int i}$[/tex]=0,j=0,x,y;
while(1)
{
ch=getc(fp);
if(ch=='\n')
break;
*(s1+i)=ch;
i++;
}
while(1)
{
ch=getc(fp);
if(ch=='\n')
break;
*(s2+j)=ch;
j++;
}
for(x=0;x<i;x++)
{
*(s3+x)=*(s1+x);
}
for(y=0;y<j;x++,y++)
{
*(s3+x)=*(s2+y);
}
for(x=0;x<i+j;x++)
{
printf("%c",*(s3+x));
}
printf("\n");
getc(fp);
}
}
Note that common skills are listed toward the top, and less common skills are listed toward the bottom. According to O*NET, what are common skills needed by Secondary School Special Education Teachers? Check all that apply.
instructing
installation
learning strategies
repairing
active listening
technology design
Answer:
A. Instucting C. Learning Strategies E. Active Listening
Explanation:
Got it right on assignment
The function below takes one parameter: an integer (begin). Complete the function so that it prints every other number starting at begin down to and including 0, each on a separate line. There are two recommended approaches for this: (1) use a for loop over a range statement with a negative step value, or (2) use a while loop, printing and decrementing the value each time.
1 - def countdown_trigger (begin):
2 i = begin
3 while i < 0:
4 print(i)
5 i -= 1 Restore original file
Answer:
Follows are code to the given question:
def countdown_trigger(begin):#defining a method countdown_trigger that accepts a parameter
i = begin#defining variable that holds parameter value
while i >= 0:#defining while loop that check i value greater than equal to0
print(i)#print i value
i -= 2 # decreasing i value by 2
print(countdown_trigger(2))#calling method
Output:
2
0
None
Explanation:
In this code, a method "countdown_trigger" is declared, that accepts "begin" variable value in its parameters, and inside the method "i" declared, that holds parameters values.
By using a while loop, that checks "i" value which is greater than equal to 0, and prints "value" by decreasing a value by 2.