Answer:
The answer is "Choice d".
Explanation:
In this topic, the option d, which is "Use a class Car, with fields: numDoors, hasAir, and milesPerGallon" is right because the flag, if air-conditioned, of its numbers of doors, was its average kilometers per gallon, qualities of either an automobile, in which each one is a basic value so that they're being fields of a class of cars.
The best design for the given program will be;
D: Use a class Car, with fields: numDoors, hasAir, and milesPerGallon.
What is the best design for the program?In this question, the best design for the program to keep track of the number of doors (2 or 4), whether the car has air conditioning, and its average number of miles per gallon is to "Use a class Car, with fields: numDoors, hasAir, and milesPerGallon"
That option is right because has classified the cars with the accurate parameters to be searched which are its numbers of doors, average miles per gallon, air condition.
Read more about programming at; https://brainly.com/question/22654163
where did the command line first get its beginning?
Answer:
About twenty years ago Jobs and Wozniak, the founders of Apple, came up with the very strange idea of selling information processing machines for use in the home. The business took off, and its founders made a lot of money and received the credit they deserved for being daring visionaries. But around the same time, Bill Gates and Paul Allen came up with an idea even stranger and more fantastical: selling computer operating systems. This was much weirder than the idea of Jobs and Wozniak. A computer at least had some sort of physical reality to it. It came in a box, you could open it up and plug it in and watch lights blink. An operating system had no tangible incarnation at all. It arrived on a disk, of course, but the disk was, in effect, nothing more than the box that the OS came in. The product itself was a very long string of ones and zeroes that, when properly installed and coddled, gave you the ability to manipulate other very long strings of ones and zeroes. Even those few who actually understood what a computer operating system was were apt to think of it as a fantastically arcane engineering prodigy, like a breeder reactor or a U-2 spy plane, and not something that could ever be (in the parlance of high-tech) "productized."
Write Java code to display a dialog box that asks the user to enter his or her desired annual income. Store the input in a double variable and display it in a message dialog box. public class AnnualIncome { public static void main(String[] args) { // Write your Java code here } }
Answer:
Follows are the code to the given question:
import java.util.*;//import package for user-input
public class AnnualIncome // defining a class AnnualIncome
{
public static void main(String[] as)//defining main method
{
double income;//defining double variable
Scanner obx=new Scanner(System.in);//creating Scanner class for user-input
System.out.print("Please enter your desired annual income: ");//print message
income=obx.nextDouble();//input double value
System.out.println("Your income "+income);//print value
}
}
Output:
Please enter your desired annual income: 98659.89
Your income 98659.89
Explanation:
In this code, a class "AnnualIncome" is declared, and inside the main method, the double variable "income" is defined, that uses the scanner class concept for input the value from the user-end, and in the next step, it uses the print method for asked user to enter value and it uses the print method, that prints income value with the given message.
Write a function endpoints that takes a list of numbers (eg. [5, 10, 15, 20, 25]) and returns a new list of only the first and last elements of the given list (eg. [5, 25]). If the input list is [5], the returned should be [5,5]. The function should return an empty list if an empty list is passed in. The function should not use any variables besides the passed in argument list_.
def endpoints(it) -> list: # YOUR CODE HERE raise NotImplementedError() ] ### BEGIN TESTS assert endpoints([5, 10, 15, 20, 251) -- 15, 25] **# END TESTS U # BEGIN TESTS assert endpoints([5]) - (5, 51 *** END TESTS [] ### BEGIN TESTS assert endpoints(0) -- 0 #*# END TESTS
I included a picture of my code below. Best of luck with your assignment.
Segmentation Faults Recall what causes segmentation fault and bus errors from lecture. Common cause is an invalid pointer or address that is being dereferenced by the C program. Use the program average.c from the assignment page for this exercise. The program is intended to find the average of all the numbers inputted by the user. Currently, it has a bus error if the input exceeds one number. Load average.c into gdb with all the appropriate information and run it. Gdb will trap on the segmentation fault and give you back the prompt. First find where the program execution ended by using backtrace (bt as shortcut) which will print out a stack trace. Find the exact line that caused the segmentation fault.
Q13. What line caused the segmentation fault?
Q14. How do you fix the line so it works properly?
You can recompile the code and run the program again. The program now reads all the input values but the average calculated is still incorrect. Use gdb to fix the program by looking at the output of read_values. To do this, either set a breakpoint using the line number or set a breakpoint in the read_values function. Then continue executing to the end of the function and view the values being returned. (To run until the end of the current function, use the finish command).
Q15. What is the bug? How do you fix it?
//average.c
#include
/*
Read a set of values from the user.
Store the sum in the sum variable and return the number of values
read.
*/
int read_values(double sum) {
int values=0,input=0;
sum = 0;
printf("Enter input values (enter 0 to finish):\n");
scanf("%d",&input);
while(input != 0) {
values++;
sum += input;
scanf("%d",input);
}
return values;
}
int main() {
double sum=0;
int values;
values = read_values(sum);
printf("Average: %g\n",sum/values);
return 0;
}
Answer:
See Explanation
Explanation:
Q13. Line that caused the segmentation fault?
The segmentation fault was caused by line 15 i.e. scanf("%d",input);
Q14. How the line was fixed?
The reason for the segmentation fault is that the instruction to get input from the user into the integer variable "input" was not done correctly.
The correction to this is to modify scanf("d",input) to scanf("%d",input);
Q15. The bug?
The bug is that the method needs to return two value; the sum of the inputted numbers and the count of the inputted numbers.
However. it only returns the count of the inputted number.
So, the average is calculated as: 0/count, which will always be 0
How it was fixed?
First, change the method definition to: void and also include an array as one of its parameters.
void read_values(double sum, double arr []) {
Next:
assign sum to arr[0] and values to arr[1]
In the main method:
Declare an array variable: double arr [2];
Call the read_values function using: read_values(sum,arr);
Get the sum and values using:
sum = arr[0];
values = arr[1];
Lastly, calculate and print average:
printf("Average: %g\n",sum/values);
See attachment for complete modified program
Prompt the user to enter the time of the day. The user should enter d for daytime and n for nighttime. Configure a boolean variable to store if it is daytime (true) or nighttime (false). Use the boolean variable to store if it is daytime or nighttime and print if the temperature is ideal if it needs to be raised if it needs to be lowered, and by how much.
Answer:
Check the photos for the answers
Explanation:
On Earth, the pattern of daytime and nighttime repeat every day. This phenomenon takes place because of the rotation of the earth on its own axis. The rotation of the earth causes day and night on earth. The length of day and night varies on the seasons and it also varies according to the part of the earth.
What are rotation and the revolution of the earth?The rotation of the earth is one of the major movements of the earth which causes the day and night over the by the movement of the earth on its own axis. The rotation of the earth takes place from west to east direction.
Revolution is also one of the movements of the earth where the earth revolves around the sun and causes changes in season and also the duration of day and night due to its tilt over its axis.
Therefore, On Earth, the pattern of daytime and nighttime repeat every day. This phenomenon takes place because of the rotation of the earth on its own axis. The rotation of the earth causes day and night on earth. The length of day and night varies on the seasons and it also varies according to the part of the earth.
Learn more about the “revolution of the earth” here:
brainly.com/question/17731832
#SPJ2
write a function insert_string_multiple_times() that has four arguments: a string, an index into the string, a string to insert, and a count. the function will return a string with count copies of the insert-string inserted starting at the index. note: you should only write the function. do not put any statements outside of the function. examples: insert_string_multiple_times('123456789',3,'xy',3) '123xyxyxy456789' insert_string_multiple_times('helloworld',5,'.',4) 'hello....world' insert_string_multiple_times('abc',0,'a',2) 'aaabc' insert_string_multiple_times('abc',0,'a',0) 'abc'
Answer:
Written in Python:
def insert_string_multiple_times(str1,indto,str2,count):
splitstr = str1[:indto]
for i in range(count):
splitstr+=str2
splitstr +=str1[indto:]
print(splitstr)
Explanation:
This line defines the method
def insert_string_multiple_times(str1,indto,str2,count):
In the above definition:
str1 represents the string
indto represents index to insert a new string
str2 represents the new string to insert
count represents the number of times str2 is to be inserted
This gets the substring from the beginning to indto - 1
splitstr = str1[:indto]
This performs an iterative operation
for i in range(count):
This appends str2 to the first part of the separated string
splitstr+=str2
This appends the remaining part of the separated string
splitstr +=str1[indto:]
This prints the new string
print(splitstr)
whats this oh _____
what is it
A) jane
B) juan.
C)juan
D) horse
Answer:
juan duhhhhh hehehe
Explanation:
alendar year. The current calendar is called the Gregorian calendar, was introduced in 1582. Every year divisible by four was created to be a leap yer, with exception of the years ending with 00 (that is, those divisible by 100) and not divisible by 400. For instance, the years 1600 and 2000 are leap years, but 1700, 1800, and 1900 are not. Write a ptogram that requests a year as input states wether it is a leap year.
Answer
Tough question.
i dont know
Explanation:
You plan on using cost based pricing. The cost of your product is 10, and you are planning a 30% mark up. What should the price of your product be?
Answer:
Selling price= $13
Explanation:
Giving the following information:
The cost of your product is $10, and you are planning a 30% mark-up.
The price of the product is calculated by adding to the manufacturing costs a predetermined percentage.
Selling price= 10*1.3
Selling price= $13
Hope this helps :)
Which heading size fits for the word headings
Answer:
Explanation:
h1 i think
Wilma is looking for facts about social media for her research project. What fact should she use for her project?
1: Communicating with social media is hard
2: Social media is a great way to communicate.
3: Social media is fun and easy to use.
4:The minimum age for some social media sites is 13.
State whether the data described below are discrete or continuous, and explain why. The durations of movies in seconds
Answer:
the data are continuous because the data can take any value in an interval.
Declare an array of 10 integers. Initialize the array with the following values: 000 101 202 303 404 505 606 707 808 909 Write a loop to search the array for a given number and tell the user if it was found. Do NOT write the entire program. Example: User input is 404 output is "found". User input is 246 output is "not found"
Answer:
In C++:
#include <iostream>
using namespace std;
int main(){
int myArray[10] = {000, 101, 202, 303, 404, 505, 606, 707, 808, 909};
int num;
bool found = false;
cout<<"Search for: ";
cin>>num;
for(int i = 0;i<10;i++){
if(myArray[i]==num){
found = true;
break;
}
}
if(found){ cout<<"found"; }
else { cout<<"not found"; }
return 0;
}
Explanation:
This line initializes the array
int myArray[10] = {000, 101, 202, 303, 404, 505, 606, 707, 808, 909};
This line declares num as integer
int num;
This initializes boolean variable found to false
bool found = false;
This prompts user for input
cout<<"Search for: ";
This gets user input
cin>>num;
This iterates through the array
for(int i = 0;i<10;i++){
This checks if num is present in the array
if(myArray[i]==num){
If yes, found is updated to true
found = true;
And the loop is exited
break;
}
}
If found is true, print "found"
if(found){ cout<<"found"; }
If found is false, print "not found"
else { cout<<"not found"; }
I need help I would really appreciate it
Answer:
Checks if it is a multiple of 3 and 5
Explanation:
Its an if statement using modulus division to check for a remainder. It checks if a number is a multiple of 3 AND 5. (&& and & both mean and in Java).
If the remainder of both is 0 then that means the mystery number is a multiple of both 3 and 5.
Create a flowchart that assigns a counselor to a student.
You need to ask a student for the first letter of his/her last name. Assign a counselor based on the following criteria:
A through M are assigned to Ms. Jones
N through Z are assigned to Mr. Sanchez
A student will not be allowed to sit in exam if his/her attendance is less than 75% .
Take the following input from user
Number of classes held
Number of classes attended
And print
Percentage of class attended
Is student allowed to sit in exam or not .
Answer:
Sorry, this is too vague to understand as you don’t have any charts, graphs, or anything
Explanation:
What is the most important basic property of melody? Why?
Most good melodies restrict their basic range to no more than an octave-and-a-half. Most good melodies use repeating elements. Listeners should be hearing certain melodic intervals, rhythms and other musical shapes repeating throughout the melody
What would a bar graph best be used for? State why and give 2-3 examples of things you could demonstrate with a bar graph.
Answer:
Reasons what bar graph is used for.
Explanation:
Bars are shown to compare and contrast data in a bar graph. For example, a data was collected through survey of average rainfall. It represents many unique categories by having many different groups. Those groups are plotted on the x-axis and on the y-axis, the measurements are plotted, like inches.
Hope this helps, thank you !!
6. Which is not considered a storage device a. USB Flash Drive b. External hard Drive c. MS-Windows d. Internal Hard Drive e. Memory Cards
Answer:
MS-Windows
Explanation:
MS-Windows is an operating system not a storage device.
This function finds the minimum number in a list. What should be replaced with in order for this function to operate as expected?
Answer choices:
A. numList[i] = min;
B. min = numList[i];
C. min = numList;
D. numList = min;
Answer: a
Explanation:
Just took the test
Write a program that reads in an integer and breaks it into a sequence of individual digits. For example, the input 16384 is displayed as 1 6 3 8 4 Make sure the input has no more than five characters and is not negative. (You don’t have to do this through code) Just make sure you enter correct data when running the program.
Answer:
Here you go :)
Explanation:
(This also works for strings as well)
usr = input("Enter a number: ")
usr = list(usr)
for n in range(len(usr)):
print(usr[n], end= " ")
The program that reads in an integer and breaks it into a sequence of individual digits is in the explanation part.
What is programming?Programming tasks include analysis, algorithm generation, algorithm accuracy and resource consumption profiling, and algorithm implementation.
Computer programming is the process of writing code that instructs a computer, application, or software program on how to perform specific actions.
Here is a Python program that reads in an integer and breaks it into a sequence of individual digits:
num = input("Enter a positive integer with no more than five digits: ")
if num.isdigit() and len(num) <= 5:
for digit in num:
print(digit, end=' ')
else:
print("Invalid input!")
Thus, this program first prompts the user to enter a positive integer with no more than five digits.
For more details regarding programming, visit:
https://brainly.com/question/11023419
#SPJ2
Write a C program that does the following: Creates a 100-element array, either statically or dynamically Fills the array with random integers between 1 and 100 inclusive Then, creates two more 100-element arrays, one holding odd values and the other holding even values (copied from the original array). These arrays might not be filled completely. Prints both of the new arrays to the console.
Answer:
Following are the code to this question:
#include <iostream>//header file
using namespace std;
int main()//main method
{
int axb[100];//defining 1-array of 100 elements
int odd_axb[100], even_axb[100];//defining two array that holds 100-elements
int i,size=0,size1=0;
for(i = 0; i < 100; i++)//defining for loop to assign value in array
{
axb[i] = rand() % 100 + 1;//using rand method to assign value with random numbers between 1 and 100
}
for(i = 0; i < 100; i++)//defining for loop that seprates array value in odd and even array
{
if(axb[i] % 2 == 0)//checking even condition
{
even_axb[size++] = axb[i];//holding even number
}
else//else block
{
odd_axb[size1++] = axb[i];//holding Odd number
}
}
//printing values
cout << "Odd array: ";//print message
for(i = 0; i <size1; i++)//use for loop for print odd numbers
{
cout << odd_axb[i]<<" ";//printing values
}
cout <<"\n\n"<< "Even array: ";//print message
for(i = 0; i <size; i++)//use for loop for print even_axb numbers
{
cout << even_axb[i] << " ";//printing values
}
return 0;
}
Output:
Odd array: 87 87 93 63 91 27 41 27 73 37 69 83 31 63 3 23 59 57 43 85 99 25 71 27 81 57 63 71 97 85 37 47 25 83 15 35 65 51 9 77 79 89 85 55 33 61 77 69 13 27 87 95
Even array: 84 78 16 94 36 50 22 28 60 64 12 68 30 24 68 36 30 70 68 94 12 30 74 22 20 38 16 14 92 74 82 6 26 28 6 30 14 58 96 46 68 44 88 4 52 100 40 40
Explanation:
In the above-program, three arrays "axb, odd_axb, and even_axb" is defined, that holds 100 elements in each, in the next step, three integer variable "i, size, and size1" is defined, in which variable "i" used in the for a loop.
In the first for loop, a rand method is defined that holds 100 random numbers in the array, and in the next, for-loop a condition statement is used that separates even, odd number and store its respective array, and in the last for loop, it prints its store values
were is the hype house
Answer:
LA
Explanation:
where the rich people live
Answer:
los angeles
Explanation:
they're also very much in the shade right now
It took her 9 more months but Marina has managed to save the full $725 plus more to cover fees to pay off the pay-day loan company. However, she forgot to account for the interest that had been compounding over time. Consider it is now 275 days later, the remaining loan was $725 and the APR is 47% compounded daily.
What is the total amount that Marina must now pay in order to pay off her the loan, accounting for interest?
What is the total amount of interest paid (not including fees)?
Answer:
she loaned 750 dollars.
it took her 9 months to repay it.
it was 275 days since she took out the loan.
the interest rate was 47% per year compounded daily.
the daily interest rate would be 47% / 365 / 100 = .0012876712 per day.
this assumes 365 days in a year, which is the standard assumption that i know of.
the future value of 750 for 275 days would be based on the formula of f = p * (1 + r) ^ n
f is the future value
p is the present value
r is the interest rate per time period (days in this case)
n is the number of time periods (days in this case).
the formula becomes:
f = 750 * (1 + .0012876712) ^ 275
solve for f to get:
f = 1068.440089.
that's the future value of the loan.
it's what she owes.
the interest rate on the loan is that value minus 750 = 318.440089.
that's how much extra she needs to pay in addition to whatever fees she was charged.
do you know that the 80s was not one of Disney's best decades? what was a reason?
Answer:
They produced a movie called the black couldren that nearly killed them.
. What projects would Excel best be used for?
Answer:
Projects that require spreadsheet organization and/or calculations between data
Explanation:
That is why Excel is a spreadsheet program
Package Newton’s method for approximating square roots (Case Study: Approximating Square Roots) in a function named newton. This function expects the input number as an argument and returns the estimate of its square root. The program should also include a main function that allows the user to compute the square roots of inputs from the user and python's estimate of its square roots until the enter/return key is pressed.An example of the program input and output is shown below:Enter a positive number or enter/return to quit: 2 The program's estimate is 1.4142135623746899 Python's estimate is 1.4142135623730951 Enter a positive number or enter/return to quit: 4 The program's estimate is 2.0000000929222947 Python's estimate is 2.0 Enter a positive number or enter/return to quit: 9 The program's estimate is 3.000000001396984 Python's estimate is 3.0 Enter a positive number or enter/return to quit
The python program that calculates the volume and the square of the volume is as follows
radius = float(input("Radius: "))
volume = (4.0/3.0) * (22.0/7.0) * radius**3
sqrtVolume = volume**0.5
print(f'The volume is {volume} units cubed')
print(f'The square root of that number is {sqrtVolume}')
How to write the program?The complete program written in Python where comments are used to explain each line is as follows
This gets the radius
radius = float(input("Radius: "))
#This calculates the volume
volume = (4.0/3.0) * (22.0/7.0) * radius**3
#This calculates the square root of the volume
sqrtVolume = volume**0.5
#This prints the volume
print(f'The volume is {volume} units cubed')
#This prints the square root of the volume
print(f'The square root of that number is {sqrtVolume}')
Therefore, The python program that calculates the volume and the square of the volume is as follows
radius = float(input("Radius: "))
volume = (4.0/3.0) * (22.0/7.0) * radius**3
sqrtVolume = volume**0.5
Read more about python programs at
brainly.com/question/26497128
#SPJ2
Subtract 01101011-00101010
Answer:
Alexa says minus 8
Explanation:
A broadband connection is defined as one that has speeds less than 256,000 bps.
Question 25 options:
True
False
Answer:
A typical broadband connection offers an Internet speed of 50 megabits per second (Mbps), or 50 million bps.
Explanation:
I think I got it right, plz tell me if im wrong
Provide a status report to your classmates and instructor. Describe any modifications that you have made to the design or documentation, discuss whether you encountered any new challenges or risks, and describe the mitigation strategy you implemented for addressing each risk. Are you meeting the objectives identified in your system proposal?What hardware, software, virtual desktop resources, and so on will you need to design and implement your system?What adjustments have you made to your document based on peer feedback?How do system components and applications interface and share data?In response to your peers, provide constructive feedback on their system design document progress and suggestions that they can incorporate into their documentation or projects. Is a sufficient amount of detailed information being provided to enable implementation by any skilled IT practitioner? Do you see any potential obstacles that they might come up against? If so, what approach can they take to overcome these challenges?When preparing your status reports, be sure that they are clear and well written. Engage your classmates in discussions that mimic the team dynamics expected in professional, real-world information technology project environments.Refer to the Discussion Rubric for directions on completing these discussions.
Answer:
that's muddled up I can't make out the question