distance=int(input("Enter the distence: ")) if distance >= 0 and distance <= 100: cost=5.00 elif distance > 100 and distance <= 500: cost=8.00 elif distance > 500 and distance <= 1000: cost=10.00 else: cost=12.00 print("The final cost is: ",cost)
Q: Binary search trees are superior than linked lists and arrays.
A: Given: Think about the following operations: You may access every component. Assume that the binary…
Q: Which issues must be resolved by an operating system in order to take use of an architecture that…
A: Introduction: Using a multithreading design causes problems for an operating system The efficiency…
Q: HAVE YOU EVER HEARD OF 'CROSSING THE BRIDGE NOODLE'? LET ME TELL YOU - IT WAS A VERY DIFFERENT KIND…
A: Question Details: There are multiple test cases. Each case starts with an integer N , the number of…
Q: Does the development automatically serve no useful purpose? of software that can translate text
A: The above question is answered in step 2 :-
Q: When giving your answer, you should be cautious to clarify why the term "assembler language" is not…
A: Introduction: Assembly languages are directly comparable to machine languages (see below for more…
Q: How can one fully understand and define an integrated information system from both a technical and…
A: Information systems: Information systems are interconnected parts that collaborate to gather,…
Q: Determine the key differences between on-premises network services and applications and those that…
A: Cloud Computing: Cloud Computing is the on-demand availability of computer system resources,…
Q: The inherent qualities of wireless networks give rise to a wide array of challenges. Describe three…
A:
Q: The benefits of a binary search tree are readily apparent when contrasted with those of other data…
A: Explanation: High-level programming languages are translated into machine code by compilers and…
Q: Why does the performance of wireless networks not compare well to that of wired networks?
A: Answer: Wireless networks, as comparison to wired networks, have a lower level of security due to…
Q: When it comes to object-oriented programming, what are the advantages of data abstraction as well as…
A: The following solutions are
Q: How well do C++ and Java do when it comes to their ability to work with assembly language?
A: The answer to the question is: We need to know how Java and C++ perform in the Assembly Language in…
Q: The material is broken up into a significant lot of discrete sections and subsections.
A: Given: The process of translating a high-level language into a lower-level language is referred to…
Q: Why does a data object not get included in a data model and what are the possible reasons for this?
A: Given: Why does a data object not get included in a data model? Data models are graphical…
Q: An extension bus connects the central processing unit (CPU) to the various peripheral devices in the…
A: Here's why that's the case: Extending a computer's internal hardware (such the CPU and RAM) to…
Q: A computer network with a star topology has an architecture in which each node in the network is…
A: In light of the fact that: What is meant by the term "star topology" when referring to a computer…
Q: Compare Binary Search with AVL Trees. Can we discuss business efficiency?
A: Start: A binary search tree is a kind of binary tree in which the tree's left child includes a value…
Q: Why is it that a data object isn't included in a data model if it's supposed to be there?
A: GIVEN: Why is it that a data item isn't included in a data model? The Oracle Warehouse Builder data…
Q: The benefits of a binary search tree are readily apparent when contrasted with those of other data…
A: The above question is solved in step 2 :-
Q: You have been given the responsibility of managing projects at your firm, which you previously held.…
A: Introduction: The software technique used is discussed and justified for the provided case. Cascade…
Q: Do you see yourself using email in the not-too-distant future? The path of an email message starts…
A: Introduction: Once an email has been sent, the message is sent to the Mail Transfer Agent (MTA) via…
Q: What are some of the benefits of using a File System website rather than an HTTP website? Also,…
A: Given: File system and HTTP (HyperText Transfer Protocol) websites are used for communicating and…
Q: When it comes to object-oriented programming, what are the advantages of data abstraction as well as…
A: Abstraction: To place it in basic terms, abstraction is everything except showing just the…
Q: Consider the three-hop scenario shown below, where the first and third links have capacity R, and…
A: in hop-by-hop congnetion control just because of buffer overflow the sender does not perform the…
Q: In this piece, we'll take a deep dive into the distinctions between assemblers, compilers, and…
A: Inspection: A compiler is a kind of software that performs the translation of high-level code into…
Q: Design a code converter that converts a decimal digit from1. (a) The 8, 4, − 2 , − 1 code to BCD…
A: According to the information given:- We have to follow the instruction and develop and simulate an…
Q: Kindly provide a rundown of three specific actions that may be taken by a business in order to…
A: Introduction: Measures taken to win back the confidence of the consumer baseThe following are three…
Q: How may these four organisational frameworks potential project that involves the development…
A: Four-frame model: The Four Frame Model separates organisations into four frames to help understand…
Q: Is there a significant difference between the architecture of a computer and the organisation of a…
A: Computer Architecture Computer Architecture is a diagram for the plan and execution of a PC…
Q: if n >= 90: print("excellent\n") elif n >= 80: print("good\n") elif n >= 70: print("fair\n") else:…
A:
Q: Could you take me through the process of integrating data for a data warehouse step by step?
A: Data integration defined: The necessity to merge data from several independent business systems into…
Q: An 8KB direct mapped write-back cache is organized as multiple blocks, each of size 32- bytes. The…
A: Given data, Cache size = 8 KB = 8 ×1024 bytes Block size = 32 bytes The processor generates 32-bit…
Q: List, BST (binary search trees), and AVL each provide their own unique challenges when it comes to…
A: Given: We need to bring attention to the amount of time that is spent searching in list, BST, and…
Q: After converting machine code into something that has some similarities to the original source…
A: Given: It is a given that the Decompile will translate machine code back into something that is…
Q: What are some of the advantages of using encapsulation in Java?
A: Encapsulation: Encapsulation refers to the technique of putting several pieces of data into a single…
Q: When someone says "Identifier attribute," what precisely do they mean by those words?
A: Identifier or key: An identifier or key is an attribute in which the value is uniquely identified…
Q: Please provide an example of how a system requirements specification may be maintained by an…
A: Given: Give an example of how a system requirements specification may be kept up to date by an…
Q: In object-oriented programming, are there any potential drawbacks associated with the use of data…
A: There is not any specific disadvantage of data abstraction in object oriented programming. Data…
Q: Which issues must be resolved by an operating system in order to take use of an architecture that…
A: Introduction: It enables several independent execution threads to use the resources provided by…
Q: List, BST (binary search trees), and AVL each provide their own unique challenges when it comes to…
A: Introduction: We need to bring attention to the amount of time that is spent searching in list, BST,…
Q: Why is it that the role of systems analyst is considered to be of such vital significance when it…
A: System analysts: System analysts are the individuals who are accountable for establishing and…
Q: You have the following AVL. 10 20 25 30 We will insert 28 into this AVL. After you insert 28 but…
A:
Q: Who was the creative force behind Mark Dean's work?
A: Given: Mark E. Dean, an American computer engineer and inventor, was born on March 8, 1957. He…
Q: Which is more difficult for compilers to implement, the VLIW or the superscalar algorithm? Why?
A: - We need to talk about difficulty of compilers to compile VLIW and superscalar algorithm.
Q: Give a condensed explanation of source data automation (SDA), highlighting at least two (2) benefits…
A: SDA stands for "Source Data Automation.": The process of acquiring digital values at the source and…
Q: 8) A histogram is a. is a frequency distribution of the pixel values of an image c. is used for…
A: Answer 8:- Option " D "
Q: What kind of risks are associated with the use of cloud services by businesses?
A: Cloud services are explained: Its definition includes cloud computing. Cloud computing isn't like…
Q: Apply (Methods switch statement, input validation, printf). Write a java program ( user either the…
A: Given rates in question 1 US $ = 1.26 Canadian dollars 1 US $ = 0.89 Euro 1 US $ = 0.74 Pounds…
Q: What are some of the qualities that define an effective use case? Have a conversation about some of…
A: Given: What characteristics define a strong use case? And furthermore have some of the same…
Q: Within the realm of computing, the notions of architecture and organisation cannot be confused with…
A: Introduction: What's the difference between architecture and organisation in terms of computers?…
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
Step by step
Solved in 2 steps
- Assignment Write a program that moves a forester unit and a desert corps unit to a given target location and prints the number of hours it took for each unit to reach the target. First, the user will give the starting X and Y positions of the forester unit as well as its base speed (all ints). Then, the starting X and Y positions of the desert corps unit as well as its base speed (all ints). Finally, the target X and Y positions (both ints) and the terrain type (std::string). Speeds are given as distance traveled in one full day (i.e., 24 hours) and is affected by the terrain type using a multiplier over the base speed. Also, after 1 full day, each unit rests for a certain number of hours. Speed multiplier and rest amount of each type of unit depending on the terrain type are as below. Speed Multiplier Rest Duration After 1 day Terrain type Forester Desert Corps Forester Desert Corps Forest 1.3 0.6 4 12 Desert 0.4 1.2 15 6 Hills 0.7 0.8 6 8 Others 1.0 0.8 8 6 After getting all this…Determine the distance between point (x1, y1) and point (x2, y2), and assign the result to pointsDistance. The calculation is:Distance = SquareRootOf( (x2 - x1)2 + (y2 - y1)2 ) #include <stdio.h>#include <math.h> int main(void) { double x1; double y1; double x2; double y2; double xDist; double yDist; double pointsDistance; xDist = 0.0; yDist = 0.0; pointsDistance = 0.0; scanf("%lf", &x1); scanf("%lf", &y1); scanf("%lf", &x2); scanf("%lf", &y2); /* Your solution goes here */ printf("%lf\n", pointsDistance); return 0;Activity 20 Electric Bill: Using Switch Statement, write a program that will calculate and show bills of the Manila Electric Company. The rates vary depending on whether the use is residential (R), commercial( C) , or industrial (I). Any other code should be treated as an error. The program should accept the subscriber ID, Subscriber Name, his total electrical consumption in a month, and the code of the consumer type. The rates are computed as follows: R: 50 plus .50 per kwh used C: 100 for the first 1000 kwh and 0.45 for each additional kwh I: 180 for the first 1000 kwh and 0.75 for each additional kwh
- Programming Exercise 10 in Chapter 6 asks you find the mean and standard deviation of five numbers. Extend this programming exercise to find the mean and standard deviation of up to 100 numbers. Suppose that the mean (average) of n numbers x1, x2, . . ., xn is x. Then the standard deviation of these numbers is:S=sqrt(((x1-x)^2+(x2-x)^2+...+(xi-x)^2+...+(xn-x)^2)/n)Q1)Further enhance your program below as follows (include a loop structure): • allow data to be continuously input for more customers • After processing the last customer’s order, display a summary report of sales of the day showing details of total number of customers, a summary of each of the packages sold for the day and the total sales value #include <stdio.h> #include <stdlib.h> #include<string.h> #pragma warning(disable:4996) int main(void) { // Variable declarations int t = 0; float k, y, u, i; int a, b, c, d; int p; float add, tt, f; char name[30], ic[20]; char addr[50]; //The personal details of customer // printf("\n========================================================================================================\n"); printf("\n Vegetable ordering system\n"); printf("\n========================================================================================================\n"); printf("Please enter your full name :"); scanf(" %[^\n]", &name);…#include <stdio.h> int main(){ int M; printf("Enter the number of chairs you want to enter:\n"); scanf("%d", &M); double price[M]; double sum = 0.0; int i=0; while(i < M) { printf("Enter price of chair #%d: ",(i+1)); scanf("%lf", &price[i]); if(price[i] < 1003) { price[i] = price[i] - price[i] * 0.10; sum = sum + price[i]; } else if(price[i] >= 1003 && price[i] <= 2006) price[i] = price[i] - price[i] * 0.15; else if(price[i] > 2006) price[i] = price[i] - price[i] * 0.20; printf("Price of chair #%d after discount is %.3lf\n", (i+1), price[i]); i++; } printf("\n\nTotal price after discount of all chairs which got a discount of 10%% is "); printf("%.3lf", sum); int N = 2; printf("\n\nN is equal to the sum of My EUI ID(1+1) = 2"); double p[N]; printf("\nEnter price of %d desks: ",…
- c++ Assignment Write a program that calculates the damage inflicted by a weapon against a target. The user will first enter the hit point of the target as well as its bludgeoning (ezici) armor and piercing (delici) armor, all as integers. Then the type of the weapon will be given as a char followed by the durability and damage of the weapon both as integers. The type of the weapon can EITHER be ‘b’ representing bludgeoning or ‘p’ representing piercing weapon. Based on the type, the user will give a final input; if it is a bludgeoning weapon, a material value as a string; if it is a piercing weapon, a thickness value as a double. After getting all this input, the program will simulate 5 consecutive attacks at the target with the given weapon and print out the final hit point of the target as an integer. The attack works differently for the type of the weapon as below and after each attack the weapon can be destroyed: If it is a bludgeoning weapon: dmg= (weapon damage-bludgeoning…C CODE 3.25 Lab: Grade Calculator Write a program that calculates your grade in this class based on weights for each category and determines the letter grade. The categories and weights have been established as: Reading Assignments (10%) Lab Assignments (20%) Lab Practicums (45%) Quizzes (5%) Midterm Exam (5%) Final Exam (15%) After you calculate the course grade, use conditionals with the following ranges to determine the letter grade: A (93 - 100) A- (90 - 92.9) B+ (87 - 89.9) B (83 - 86.9) B- (80 - 82.9) C+ (77 - 79.9) C (73 - 76.9) If the grade is below 73%, display the text "You did not pass this semester." The code should interact as follows: GRADE ENTRY Enter your reading total (%): 82 Enter your lab total (%): 73 Enter your lab practicum total (%): 75 Enter your quizzes total (%): 92 Enter your midterm total (%): 86 Enter your final exam total (%): 88 RESULTS Your final course grade is: 78.65% You received a C+ for the semester. NOTE: In the grade entry section, the…Assume that qty and salesReps are both integers. Use a type cast expression to rewrite the following statement so it will no longer perform integer division.unitsEach = qty / salesReps;
- 4. During each summer, John and Jessica grow vegetables in their backyard and buy seeds and fertilizer from a local nursery. The nursery carries different types of vegetable fertilizers in various bag sizes. When buying a particular fertilizer, they want to know the price of the fertilizer per pound and the cost of fertilizing per square foot. The following program prompts the user to enter the size of the fertilizer bag, in pounds, the cost of the bag, and the area, in square feet, that can be covered by the bag. The program should output the desired result. However, the program contains logic errors. Find and correct the logic errors so that the program works properly. // Logic errors. #include #include using namespace std; int main() { double costs double area; double bagsize; cout > bagsize; cout > cost; cout > area; cout << endl; cout << "The cost of the fertilizer per pound is: $" << bagsize / cost << endl; cout << "The cost of fertilizing per square foot is: $" << area / cost << endl; return 0; }C++ Visual 2019 A particular talent competition has five judges, each of whom awards a score between 0 and 10 to each performer. Fractional scores, such as 8.3, are allowed. A performer's final score is determined by dropping the highest and lowest score received, then averaging the three remaining scores. Write a program that uses this method to calculate a contestant's score. It should include the following functions: void getJudgeData() should ask the user for a judge's score, store it in a reference parameter variable, and validate it. This function should be called by main once for each of the five judges. void calcScore() should calculate and display the average of the three scores that remain after dropping the highest and lowest scores the performer received. This function should be called just once by main and should be passed the five scores. The last two functions, described below, should be called by calcScore, which uses the returned information to determine which of the…Computer Fundamentals and Programming 2 Write a program that determines a student’s grade. The program will accept 3 scores and computes the average score. Determine the grade based on the following rules: - If the average score is equal or greater than 90, the grade is A. - If the average score is greater than or equal to 70 and less than 90, the grade is B. - If the average score is greater than or equal to 50 and less than 70, the grade is C. - If the average score is less than 50, the grade is F. Source Codes and Print Screen of the Output