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
2. You are developing a new application that optimizes the processing of a warehouse’s operations. When the products arrive, they are stored on warehouse racks. To minimize the time it takes to retrieve an item, the items that arrive last are the first to go out. You need to represent the items that arrive and leave the warehouse in a data structure. Which data structure should you use to represent this situation?
a) array
b) linked list
c) stack
d) queue
Answer:
Option d) is correct
Explanation:
To optimize the processing of a warehouse’s operations, products are stored on warehouse racks when they arrive. The items that arrive last are the first to go out to minimize the time it takes to retrieve an item. The items that arrive need to be represented and the warehouse should be left in a data structure. The data structure which should you use to represent this situation is a queue.
Option d) is correct
When using the Mirror command you can delete the source object as the last step of the command. True or false
Answer:
The anwser is true it is true.
Use the drop-down menus to explain what happens when a manager assigns a task in Outlook.
1. Managers can assign tasks to other users within_______ .
2. Once the task is assigned, Outlook__________ the assignment to that user.
3. The user must_______ the task to have it placed in their_________ .
Answer:
1. an organization
2. emails
3. accept
4. to-do list
Explanation: edge
Answer:Use the drop-down menus to complete statements about assigning tasks in Outlook.
A Task Request form is an interactive way to assign tasks to
✔ Outlook users
and report updates on the status of an assigned task.
An assigned task sends
✔ an email
request for the user to accept or decline and sends
✔ an automated response message
to the assigner.
Explanation:
Write a program which will enter information relating to a speeding violation and then compute the amount of the speeding ticket. The program will need to enter the posted speed limit, actual speed the car was going, and whether or not the car was in a school zone and the date of the violation. Additionally, you will collect information about the driver (see output for specifics). The way speeding tickets are computed differs from city to city. For this assignment, we will use these rules, which need to be applied in this order:
Answer:
In Java:
import java.util.*;
public class Main{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
float speedlimit, actualspeed;
String ddate;
int schoolzone;
System.out.print("Speed Limit: ");
speedlimit = input.nextFloat();
System.out.print("Actual Speed: ");
actualspeed = input.nextFloat();
System.out.print("Date: ");
ddate = input.nextLine();
System.out.print("School Zone (1-Yes): ");
schoolzone = input.nextInt();
float ticket = 75;
ticket += 6 * (actualspeed - speedlimit);
if(actualspeed - speedlimit > 30){
ticket+=160;
}
if(schoolzone == 1){
ticket*=2;
}
System.out.print("Date: "+ddate);
System.out.print("Speed Limit: "+speedlimit);
System.out.print("Actual Speed: "+actualspeed);
System.out.print("Ticket: "+ticket);
}
}
Explanation:
See attachment for complete program requirements
This declares speedlimit and actualspeed as floats
float speedlimit, actualspeed;
This declares ddate as string
String ddate;
This declares schoolzone as integer
int schoolzone;
This prompts the user for speed limit
System.out.print("Speed Limit: ");
This gets the speed limit
speedlimit = input.nextFloat();
This prompts the user for actual speed
System.out.print("Actual Speed: ");
This gets the actual speed
actualspeed = input.nextFloat();
This prompts the user for date
System.out.print("Date: ");
This gets the date
ddate = input.nextLine();
This prompts the user for school zone (1 means Yes, other inputs means No)
System.out.print("School Zone (1-Yes): ");
This gets the input for schoolzone
schoolzone = input.nextInt();
This initializes ticket to $75
float ticket = 75;
This calculates the additional cost based on difference between speed limits and the actual speed
ticket += 6 * (actualspeed - speedlimit);
If the difference between the speeds is greater than 30, this adds 160 to the ticket
if(actualspeed - speedlimit > 30){
ticket+=160;
}
If it is in a school zone, this doubles the ticket
if(schoolzone == 1){
ticket*=2;
}
The following print the ticket information
System.out.print("Date: "+ddate);
System.out.print("Speed Limit: "+speedlimit);
System.out.print("Actual Speed: "+actualspeed);
System.out.print("Ticket: "+ticket);
Write a java program for the following
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:
import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int classesHeld, classesAttended;
double percentage;
System.out.print("Enter number of classes held: ");
classesHeld = input.nextInt();
System.out.print("Enter number of classes attended: ");
classesAttended = input.nextInt();
percentage = (double) classesAttended / classesHeld;
if(percentage < 0.75)
System.out.println("You are not allowed to sit in exam");
else
System.out.println("You are allowed to sit in exam");
}
}
Explanation:
Import the Scanner to be able to get input from the user
Create a Scanner object to get input
Declare the variables
Ask the user to enter classesHeld and classesAttended
Calculate the percentage, divide the classesAttended by classesHeld. You also need to cast the one of the variable to double. Otherwise, the result would be an int
Check the percentage. If it is smaller than 0.75 (75% equals 0.75), print that the student is not allowed. Otherwise, print that the student is allowed
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 !!
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
who likes tom holland as spiderman and his web shooter tippets when he swings off buildings in new york city midtown, Forest Hills and he is a superhero and I am his humongous fan of spiderman or peter parker the spider man
Answer:
YESSSS!!!!
Explanation:
Answer:
ayo no spikar english :u
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.
Which statements about editing an existing Contact in Outlook are true? Check all that apply.
Double-click a contact to open the editing page.
Right-click a contact and click Edit to open the editing page.
Click the Edit link in the Contact Information page to open the editing page.
Contacts can be edited in the body of an email message.
Existing fields can be edited for a Contact in the editing page.
New fields can be added for a Contact on the editing page.
Answer:
Double-click a contact to open the editing page.
Right-click a contact and click Edit to open the editing page.
Click the Edit link in the Contact Information page to open the editing page.
Existing fields can be edited for a Contact in the editing page.
New fields can be added for a Contact on the editing page.
Explanation:
just did it
The following statements should be considered for editing into an existing contact in Outlook:
Double click the contact in order to open the editing page.Right-click the contact & click on edit to open the editing page.Click on the edit link in the page of contact information for editing the page.The fields that are existed could be altered for a contact in an editing page.The new fields for the contact on the editing page could be added.The following information should be relevant:
The Contact & editing page is important.Contacts can't be added to the body of the email message.Therefore we can conclude the above statements should be considered for altering an existing contact in outlook.
Learn more about the outlook here: brainly.com/question/20494929
Define a function roll() that takes no arguments, and returns a random integer from 1 to 6. Before proceeding further, we recommend you write a short main method to test it out and make sure it gives you the right values. Comment this main out after you are satisfied that roll() works.
Answer:
Follows are the code to this question:
#include <iostream>//defining a header file
using namespace std;
int roll()//defining a method roll
{
return 1+(rand() %5);//use return keyword that uses a rand method
}
int main()//defining main method
{
cout<<roll();//calling roll method that print is value
return 0;
}
Output:
4
Explanation:
In this code, the "roll" method is defined, that uses the rand method with the return keyword, that returns the value between 1 to 6, and in the next step, the main method is declared, that uses the print method to calls the roll method.
A marketing plan includes a number of factors, including the marketing mix.
What is the marketing mix?
A. The variables of product, price, place, and promotion
B. Using names and symbols to ideny the company's products
C. How the company intends for customers to view its product
relative to the competition
D. A plan for spending money
SUBMIT
Write a program called clump that accepts an ArrayList of strings as a parameter and replaces each pair of strings with a single string that consists of the two original strings in parentheses separated by a space. If the list is of odd length, the final element is unchanged. For example, suppose that a list contains
Answer:
In Java:
public static void clump(ArrayList<String> MyList) {
for(int i = 0; i<MyList.size()-1;i++){
String newStr = "(" + MyList.get(i) + " "+ MyList.get(i + 1) + ")";
MyList.set(i, newStr);
MyList.remove(i + 1);
}
System.out.println("Updated ArrayList: " + MyList);
}
Explanation:
First, we define the method
public static void clump(ArrayList<String> MyList) {
Next, we iterate through the ArrayList
for(int i = 0; i<MyList.size()-1;i++){
This clumps/merges every other ArrayList element
String newArr = "(" + MyList.get(i) + " "+ MyList.get(i + 1) + ")";
This updates the elements of the ArrayList
MyList.set(i, newArr);
This removes ArrayList elements at odd indices (e.g. 1,3...)
MyList.remove(i + 1);
}
This prints the updated List
System.out.println("Updated ArrayList: " + MyList);
}
when food material are preserved at a temperature just above freezing the temperature process is called
What’s the difference packet switching and message switching??
Changing the color of the text in your document is an example of
Answer:
???????????uhhh text change..?
Explanation:
Answer:
being creative
Explanation:
cause y not?
Which of the following is the best way to keep up with trends in your industry?
Read the newspaper
Watch the news
Conduct scholarly research
Use social media
Answer:
Use social media
Explanation:
Social media has significantly helped to bridge gaps in the communication as end users are able to send and receive messages in real-time without any form of delay. Also, social media platforms facilitate the connection of friends, families, co-workers and brands with one another by sharing memories, innovations, new technologies, knowledge and ideas without being physically present in the same location through the use of social network services such as Face-book, Insta-gram, Twitter, LinkedIn, Zoom, Sk-ype, Hangout, You-Tube, etc.
Hence, the best way to keep up with trends in your industry is to through the use of social media because you get to see and learn from trending ideas, methods of production, technologies, and innovations that are being posted from time to time.
Write VHDL code for the circuit corresponding to an 8-bit Carry Lookahead Adder (CLA) using structural VHDL (port maps). (To be completed before your lab session.)
Answer:
perdo si la pusiera es español te ayudo pero no esta en español
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.
Write a program that calculates the occupancy rate for a hotel. The program should start by asking the user how many floors the hotel has. A for loop should then iterate once for each floor. In each iteration of the for loop, the program should ask the user for the number of rooms of the floor and how many of them are occupied. After all of the iterations are complete the program should display how many rooms the hotel has, how many of them are occupied, and the percentage of rooms that are occupied.
Answer:
In Python:
floor = int(input("Number of floors: "))
totalrooms = 0
totaloccupied = 0
for i in range(floor):
rooms = int(input("Rooms in floor "+str(i+1)+": "))
occupied = int(input("Occupied Rooms in floor "+str(i+1)+": "))
totalrooms = totalrooms + rooms
totaloccupied = totaloccupied + occupied
print("Total Rooms: "+str(totalrooms))
print("Total Occupied: "+str(totaloccupied))
print("Percentage Occupied: "+str(round(100*totaloccupied/totalrooms,2))+"%")
Explanation:
This line prompts the user for number of rooms
floor = int(input("Number of floors: "))
This line initializes totalrooms to 0
totalrooms = 0
This line initializes totaloccupied to 0
totaloccupied = 0
This iterates through the floors
for i in range(floor):
This gets the number of rooms in each floor
rooms = int(input("Rooms in floor "+str(i+1)+": "))
This gets the number of occupied rooms in each floor
occupied = int(input("Occupied Rooms in floor "+str(i+1)+": "))
This calculates the total number of rooms
totalrooms = totalrooms + rooms
This calculates the total number of occupied rooms
totaloccupied = totaloccupied + occupied
This prints the total number of rooms
print("Total Rooms: "+str(totalrooms))
This prints the total number of occupied rooms
print("Total Occupied: "+str(totaloccupied))
This prints the percentage of occupied rooms to 2 decimal places
print("Percentage Occupied: "+str(round(100*totaloccupied/totalrooms,2))+"%")
What are the WORST computer malware in your opinion it can be worms backdoors and trojans I just want a input, nothing right or wrong
Answer:
I think probably mydoom
Explanation:
as it estimated 38 billion dollars in damage, also this malware is technically a worm
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.
What should Stephan do to improve his study environment? Check all that apply. remove distracting technology have easy access to his study resources ask his parents to leave the room leave some food and drink for snacks while studying allow his dad to stay only if he is helping with studying remove all food and drink from the room
Answer:
I. Remove distracting technology.
II. Have easy access to his study resources.
III. Allow his dad to stay only if he is helping with studying.
Explanation:
A study environment can be defined as a place set aside for reading and studying of educational materials.
In order to facilitate or enhance the ability of an individual (student) to learn and assimilate information quickly, it is very important to ensure that the study environment is devoid of any form of distraction and contains the necessary study materials (resources).
Hence, to improve his study environment, Stephan should do the following;
I. Remove distracting technology such as television, radio, games, etc.
II. Have easy access to his study resources. Stephan shouldn't keep his study materials far away from his study area.
III. Allow his dad to stay only if he is helping with studying.
Answer:the person above it right
Explanation:
I need help for my computer science class I would appreciate it
Answer:
21
Explanation:
a = 7
b = 7
c = 2
7 is greater than or equal to 7 , so it will return 7 + 7 *2 which is 21
Which of these is NOT a mathematical operator used in Python?
A. !
B. /
C. %
D. *
why was the 80s bad for Disney i know one example but ill tell you after you answer
Answer:
The dark stories behind it? i dont know lol
Compression algorithms vary in how much they can reduce the size of a document.
Which of the following would likely be the hardest to compress?
Choose 1 answer:
A. The Declaration of Independence
B. The lyrics to all of the songs by The Beatles
C. A document of randomly generated letters
D. A book of nursery rhymes for children
The statement that represents the thing that would likely be the hardest to compress is a document of randomly generated letters. Thus, the most valid option for this question is C.
What is an Algorithm?An algorithm may be characterized as a type of methodology that is significantly utilized for solving a problem or performing a computation with respect to any numerical problems.
According to the context of this question, an algorithm is a set of instructions that allows a user to perform solutions with respect to several numerical and other program-related queries. It can significantly act as an accurate list of instructions that conduct particular actions step by step in either hardware- or software-based routines.
Therefore, the statement that represents the thing that would likely be the hardest to compress is a document of randomly generated letters. Thus, the most valid option for this question is C.
To learn more about Algorithms, refer to the link:
https://brainly.com/question/24953880
#SPJ3
Which heading size fits for the word headings
Answer:
Explanation:
h1 i think
The ABC box company makes square puzzle cubes that measure 4 inches along each edge. They shipped the cubes in a box 8 in x 12 in x 16 in. How many cubes can they ship in the box?
Answer: They can ship 32 puzzle cubes in the box.
Explanation: So the volume of each puzzle cubes = side³
=(4)³ cubic inches.
Then the volume of the box is= (8×12×16) cubic inches.
(8×12×16)/4^3= 32
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