C program
Q: Consider the following CFG with starting variable S and Σ = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0}: S → M U ...
A: In this question, we are given a CFG and we have to provide derivation tree for the given string. Al...
Q: Write a MIPS program that asks the user to enter three integers. These three integers should be pass...
A: The following code takes 3 integers as input and provides with the largest and smallest of three:
Q: Troy who is in his 1st grade and is having a hard time learning how to count numbers from 0 – 50. He...
A: Use an if conditional statement to check whether we have to display the number or message
Q: Write a Python function that takes a positive integer(n) as an argument and returns the largest powe...
A: The answer is
Q: Question: In the function below called add_five, complete the code that adds 5 to the number sent to...
A: Solution :
Q: Construct the Max. Binary Heap on the input array C O MPUTERS.
A: Java code to construct Max. Binary heap for "COMPUTERS": public class MaxHeap { private int[] Heap...
Q: O Write a literate version of the code O EXPLAIN HOW YOUR PROGRAM WORKS O Write a program using coun...
A: public class Attraction { // instance variables private String name; private int openin...
Q: 1. Based on the function definition below, write a complete C program with the implementation of fun...
A: Given: based on the function given write complete C program with implementation of functions.
Q: Suppose ArrayList x contains two strings [Beijing, Singapore]. Which of the following methods will c...
A: Given statement: Suppose ArrayList x contains two strings [Beijing, Singapore]. Which of the follo...
Q: Need correct answer only upvote otherwise downvotes output equation of digital circuit
A: The answer for output equation of digital circuit is
Q: 10. Symbolize the following statement in P. Be sure to include your translation key. "The CEO said t...
A: The answer given below
Q: or a given Kar O a. less sim
A: Given For a given Karnaugh-map, the SOP form is:
Q: 6. What is it and how are misuse or abuse cases help security engineers design measures to protect a...
A: Required Answer is given in the step 2
Q: Distinguish between a contemporary telecommunication network (based on telephone infrastructure) and...
A: Introduction: A telecommunications network is a collection of nodes linked through telecommunication...
Q: AVA programming language
A: the reference of the object is passed while invoking an method with an object argument.
Q: Which of the following can best describe the result of a round-robin tournament?
A:
Q: IN JAVA Which is true? A. The FileOutputStream class includes println( ) B. A PrintWriter object ...
A: ANSWER:- OPTION B is Correct. A PrintWriter Object Should be Closed Using close().
Q: Palindromes - “A palindrome” is a string that reads the same from both directions. For example: the...
A: #include<iostream>#include<stack>using namespace std;bool function(string s){ stack&l...
Q: Why is virtual memory not often used in embedded systems ?
A: Embedded systems are the hardware with software which are used for performing a specific task. These...
Q: Exercise1: Write C++ program binary searching for search value in array list and display its positi...
A: kindly, upload remaining questions seperately. C++ Program for Exercise 1: #include <iostream...
Q: Page 3 • C++ Program demonstrates the implementation of Modular Exponentiation Algorithm.
A: Given, We have to write a program in C++ to demonstrate the implementation of the Modular Exponenti...
Q: Assuming class B has a pure virtual member function, choose the best statement below. class B is an...
A: The solution is given below
Q: JAVA Which is true about arrays and methods? A. Arrays cannot be passed to methods B. Passing an ...
A: Answer is: An array is passed to a method as a reference. Array can be passed to methods just like...
Q: all,
A: Given The predicate for the following proposition – “Harry plays football” – can be written as:
Q: int main() { Player golfer("Tiger Woods", "123456789"); BasketballPlayer pointGuard("Step...
A: The answer is given below
Q: 1. Write a C program to get a number from the user and print whether it is positive or negative. ...
A: algorithm: 1. read number n 2. if(n<0) print("The number is negetive"); else print("The ...
Q: the most critical features of the a.NET security standards are described The Microsoft.NET security ...
A: The answer is
Q: Question 16. Which of the following is not a technique used as threat precursors? Reconnaissance O P...
A: As per our policy, "Since you have asked multiple questions, we will solve the first question for yo...
Q: a. Write a line by line explanation for the following program. p. Write a short paragraph on what is...
A: Actually, assembly language is a low low-level language. It uses mnemonic codes and labels to repres...
Q: 1. Let A = {5, 6, 7, 8} and B = {set of integers}. Illustrate the functionf: p → p + 4. where pE A a...
A:
Q: Describe a benefit from allowing a new class to extend an existing class.
A: Follwing Java Code Shows Allowing a new class to extend and existing class
Q: How many objects of type Car are created? Car mustang = new Car(); Car prius; int miles; Truck tund...
A: The correct solution along with the intern is given below.
Q: How does data go from one layer to the next in the internet model? Why do you feel we need a second ...
A: Given: How does data go from one layer to the next in the internet model?Why do you feel we need a s...
Q: Consider the following class Time, which represents a time using three ints for hour, minute and sec...
A: #include <iostream>using namespace std; class Time { private: int hour; int min; int sec; ...
Q: USE C++ ONLY! Consider the following class Time, which represents a time using three ints for hour,...
A: The code is:
Q: Write a Java interface called Priority that includes two methods: setPriority and getPriority. The i...
A: The answer given as below:
Q: ement an automatic teller system (ATM) using classes, arrays, arraylists, iteration, text files, and...
A: Design and implement an automatic teller system (ATM) usingclasses, arrays, arraylists, iteration, t...
Q: How to find cosine similarities of specific rows from csv file using python Do example with csv...
A: Answer: Python Source Code: import pandas as pdfrom sklearn.metrics.pairwise import cosine_similarit...
Q: Create and test a stored procedure that uses the CompetitorCountry view that allows one to pass in t...
A: create procedure select_athletes @CountryCode nvarchar2(10) as select * from CompetitorCountry where...
Q: Given two sorted arrays, your task is to merge them in a new sorted array. Write a complete program ...
A: Hi. Let's move on to the code in the next step. I have included comments in the code that will help ...
Q: QUESTION 10 Given the following AVL tree: a) What is the node balance of the node with the value 45:...
A: As per policy only three subparts of one question can be answered once
Q: Why is virtual memory not often used in embedded systems?
A: According to the question assets which might be sincerely to be had on a given gadget which creates...
Q: N JAVA What is the error in readFile()? public void readFile(){ FileInputStream fbStream = null...
A: Here we are creating a method readFile() Then we create FileInputStream, Scanner reference variables...
Q: Q) Write the assembly language instructions required to find the square of 20 8-bit signed numbers, ...
A: Assembly language program to squire 8 bit value
Q: What is the physical layer's purpose?
A: Physical Layer is the lowest layer in the Open System Interconnection (OSI) Model which is a physica...
Q: Write a C++ program that allows a user to play your mixtape, one song at a time, or all at once. The...
A: Program in C++ (Comments are included for better understanding) #include <iostream> ...
Q: a. In an effort to extend AiT TV coverage in Ghana and West Africa without the help of any televisio...
A: According to the information given:- we have Mearth =5.98x1024kg Rearth =6.37x106m G=6.673x10-11N.m2...
Q: 3. Fill in the blank. ___________ the security controls in the information system on an ongoing bas...
A: Individuals with information security assessment and monitoring responsibilities an ongoing basis to...
Q: For a direct-mapped cache design with a 32-bit address, the following bits of the address are used t...
A: Solution:
Q: The elevation of point C on the chimney shown in Figure 6.3 (from your textbook) is de observed. Sta...
A:
5. Write a C
Test Data
Input number: 3
Expected Output :
Wednesday
Step by step
Solved in 2 steps with 1 images
- Written in C# Language Please! A fixed percentage of water is taken from a well each day. Request values for W and P where: ▪ W is the amount (in litres) of water in the well at the start of the first day ▪ P is the percentage of the water in the well taken out each day Write a program to print the number of the day, the amount taken for that day and the amount remaining at the end of the day. The output should be terminated when 30 days have been printed or the amount of water remaining is less than 100 litres, whichever comes first. For example, if W = 1000 and P = 10, the output should start as follows: Day Amount Taken Amount Remaining 1 100 900 2 90 810 3 81 729 Note: The amount taken and amount remaining should be displayed to 2 decimal places.5. Write a C program that keeps a number from the user and generates an integer between 1 and 7 and displays the name of the weekday. Test Data Input number: 3 Expected Output : WednesdayUniversity of Babylon College of Information Technology Department of Information Security Programing Fundamentals C++, First Stage Assignment (2) / Due Date March 1,2021: 12pm Q1. Write a program to read one mark of a student from keyboard and check whether the student is pass or fail, then print "pass" if the mark is greater than or equal to 50 and print "fail" if the mark is less than 50. Q2. Write a program to read three numbers from keyboard and find out the maximum out of these three numbers (using nested if-else). Q3. Write a program to read marks from keyboard display equivalent grade cording to the following table. (using if-else if leader). Iyour program should Grade Distinction Marks 100 - 80 60 - 79 First Class 35 - 59 Second Class 0- 34 Fail Q4. Write a program to read a number in the range from 1 to 7 and accordingly it should display MONDAY to SUNDAY (using if-else-if leader). Q5. Write a program to read number for keyboard and check whether the given number is positive,…
- 4. Write a C program that reads a floating-point number and prints "zero" if the number is zero. Otherwise, print "positive" or "negative". Add "small" if the absolute value of the number is less than 1, or "large" if it exceeds 1,000,000. Test Data Input value: 25 Expected Output : Positive number 5. Write a C program that keeps a number from the user and generates an integer between 1 and 7 and displays the name of the weekday. Test Data Input number: 3 Expected Output : Wednesday 6. Write a C program that reads in two floating-point numbers and tests whether they are the same up to three decimal places. Test Data Input floating-point number: 1256 Input floating-point another number: 3254 Expected Output : They are differentC++ A company hired 10 temporary workers who are paid hourly and you are given a data file that contains the last name of the employees, the number of hours each employee worked in a week, and the hourly pay rate of each employee. You are asked to write a program that computes each employee’s weekly pay and the average salary of all employees. The program then outputs the weekly pay of each employee, the average weekly pay, and the names of all the employees whose pay is greater than or equal to the average pay. If the number of hours worked in a week is more than 40, then the pay rate for the hours over 40 is 1.5 times the regular hourly rate. Use two parallel arrays: a one-dimensional array to store the names of all the employees (Name) a two-dimensional array of 10 rows and 3 columns to store the number of hours an employee worked in a week (Hrs Worked), the hourly pay rate (Pay Rate), and the weekly pay (Salary). Your program must contain at least the following functions: a…23. Write a C program that reads three floating values and check if it is possible to make a triangle with them. Also calculate the perimeter of the triangle if the said values are valid. Go to the editor Test Data : Input the first number: 25 Input the second number: 15 Input the third number: 35 Expected Output: Perimeter = 75.0 %3D
- Write a C Program A bank wants a program that determines the yearly interest earned on a guaranteed investment certificate (GIC), given a number of years. If the investment is for five years, the interest is 8.2% per year; if it is for one year, the interest is 5%. Print on the screen "Invalid data. Please try again later.", if the user enters any value other than 1 or 5 for the number of years of investment. Write a complete C program to determine the amount of interest earned per year. Hint: Interest - amount * percentageC++ A company hired 10 temporary workers who are paid hourly and you are given a data file that contains the last name of the employees, the number of hours each employee worked in a week, and the hourly pay rate of each employee. You are asked to write a program that computes each employ- ee’s weekly pay and the average salary of all the workers. The program then outputs the weekly pay of each employee, the average weekly pay, and the names of all the employees whose pay is greater than or equal to the average pay. If the number of hours worked in a week is more than 40, then the pay rate for the hours over 40 is 1.5 times the regular hourly rate. Use two parallel arrays: a one-dimensional array to store the names of all the employees, and a two-dimensional array of 10 rows and 3 columns to store the number of hours an employee worked in a week, the hourly pay rate, and the weekly pay. Your program must contain at least the follow- ing functions—a function to read the data from…C++ - When analyzing data sets, such as data for human heights or for human weights, a common step is to adjust the data. This can be done by normalizing to values between 0 and 1, or throwing away outliers. For this program, adjust the values by subtracting the smallest value from all the values. The input begins with an integer indicating the number of integers that follow. Ex: If the input is: 5 30 50 10 70 65 the output is: 20 40 0 60 55 The 5 indicates that there are five values in the list, namely 30, 50, 10, 70, and 65. 10 is the smallest value in the list, so is subtracted from each value in the list. For coding simplicity, follow every output value by a space, including the last one.
- C++ A company hired 10 temporary workers who are paid hourly and you are given a data file that contains the last name of the employees, the number of hours each employee worked in a week, and the hourly pay rate of each employee. You are asked to write a program that computes each employee's weekly pay and the average salary of all the workers. The program then outputs the weekly pay of each employee, the average weekly pay, and the names of all the employees whose pay is greater than or equal to the average pay. If the number of hours worked in a week is more than 40 hours, then the pay rate for the hours over 40 is 1.5 times the regular hourly rate. Use two parallel arrays: a one-dimensional array to store the names of all the employees, and a two-dimensional array of 10 rows and 3 columns to store the number of hours an employee worked in a week, the hourly pay rate, and the weekly pay. Your program must contain at least the following functions—a function to read the data from the…C++ Question Write a program that reads any 5 numbers as in the given sample of output below: Sample of output: Enter any 5 integer value. 1 2 -1 3 0 The number of positive value is 3 The numbers are: 1 2 3 The number of negative value is 1 The numbers are: -1 The 0 number is 1 The total is 5.0 The average is 1.25Switch case C# exerciseAssignment 1. Write C# program to print (Day/Night) program according to given D/N. Enter time of day (day/Night) : D Day