Write a program that asks the user to input the following data for n employees: - • Basic Salary • Experience years • Employee Class Then do the following for each one: - float value. integer value integer value (1 or 2 or 3) only. 1. Calculate the Basic allowance according to the following table:
Q: Write a program to calculate the total final marks for a subject. There are four assessment types…
A: Here is the c program of above problem. See below steps for code.
Q: The following variables have been initialized for you: int a; float f; double d; You have to cast…
A: As per the requirement program is developed. Note: In the question programming language is not…
Q: Draw a bar chart of 5 values entered by the user (>=0), where the y-axis is along the rows and the…
A: PROGRAM CODE:…
Q: public static int sum(int low, int high) { if (low > high) { return 0; } if (low % 3 == 0 && low % 2…
A: public static int sum(int low, int high){ int total=0; while(low<high){…
Q: Suppose you are given the following information: Integer:first_day. This is the day on Jan 1…
A: #include <bits/stdc++.h>using namespace std; int main(int argc,char *argv[]) { int…
Q: Write a program continuously asks the user to enter a sentence until they type "-999". It should…
A: As you have not mentioned the programming language, I have written the program in java import…
Q: Write a program continuously asks the user to enter a sentence until they type "-999". It should…
A: #the function definition for uppercasedef Uppercase(sentence,n): upper='' for i in range(n):…
Q: Rewrite the following using the structure construct. int number_of_cars=3; long id[number_of_cars];…
A: The program is written in C Language. Check the program screenshot for the correct indentation.…
Q: what will be stored in n by the following statement int n; n=17+10/7;
A: Definition: Data types: It is defined as the attribute of the data that will inform the…
Q: Write a program that calculates and prints the take-home pay for a commissioned sales employee.…
A: I have written this in C# Algorithm:1. Intialize employeename is Joshuva Mountain 2. Declare…
Q: programming for business field in python write a program to find the depreciation value of an…
A: Given, Amount/Price of the asset Year of service Depreciation Rate Depreciated/New Reduced Amount…
Q: #include float square ( float x); void main ( ) { float m, n; printf ( "\nEnter some number for…
A: The given C program is used to find the square of the number using the float values. given program…
Q: Write an application in Java which defines String=”hello world”, convert it into character array…
A: code: import java.util.*; public class GFG { public static void main(String args[]) {…
Q: Write a program that calculates the revenue of a trip of a train composed of several train-cars. For…
A: #include<iostream> #include<string> #include<vector> using namespace std; class…
Q: (a) Suppose Circle is a class. Now draw the memory allocation of the following four statements.…
A: Here, a Circle object with the name c1 is declared. Then, c1 is transferred to another circle (c2)…
Q: The following is the contents of the python file "student.py": # Name: [your name] # email:…
A: Algorithm: Start Add __add__() method to the given class which adds the passed data to courses…
Q: Set course_student's last_name to Smith, age_years to 20, and id_num to 9999. Sample output for the…
A: Solution :
Q: 6: forLoops.cpp) a) Print the even numbers between 3 and 43. b) Print every third letter starting…
A: void a() { int i; cout << "a() ->" << endl; for(i = 4; i < 43; i += 2) { cout…
Q: i. The number of distinct combinations of n objects, taken rat a time, is determined by the…
A: I give the code in Java along with output and code screenshot
Q: b. Using Data Encapsulation in Python, give the output of the Pseudocode below: class Computer: def…
A: As per our guidelines, we are supposed to answer only one question. I have answered two of your…
Q: write python code design Foodcart class and Food class so that the following code provides the…
A: Algorithm: Start Create a class Foodcart with attributes cart, cartName Implement constructor to…
Q: 1. Write the output of the following program. #include int main(void) printf ("Introduction to…
A: In this question, we have C code. In given code we have 4 printf statements which are printing text…
Q: Write a program that can be used to assign seats for a commercial airplane. The airplane has 13…
A: #include <iostream>#include <string>#include <iomanip>#define NUMBER_ROWS…
Q: (b) Below is part of a code, consider this program and show where each part of code is saved in the…
A: Given: Below is the part of a code , Consider this program and show where each part of code is…
Q: Write a program that will find the maximum number from 3 float type numbers.You have to use getMax…
A: The program is written in C++ with structured approach. The function getMax() has 3 arguments of…
Q: Write a program that calculates the total cost of airplane tickets according to the following table:…
A: Note: As you have not mentioned the language of the program. The below code is given in CPP…
Q: The following declaration, program, and program segment has errors. Locate as many as you can. class…
A: This program consists of seven errors. The following statements contain errors: The first error…
Q: In this java program please explain everyline of this code. Source Code: // Online Java Compiler…
A: The above java program is to find 1. Total iterations made 2. Sum of all iterations Initially, we…
Q: value) Suppose you save $100 each month into a savings account with an annual interest rate of 5%.…
A: Given: value) Suppose you save $100 each month into a savings account with an annual interest rate…
Q: What will be the result of running the following code fragment? int time = 0; int year = 0; int rate…
A: The, given code is: int time = 0;int year = 0;int rate = 0;int principal = 1000;int interest =…
Q: uppose we are developing a program that a car dealership can use to manage its inventory of used…
A: Below is the required java program. Program Approach: Create a class as Automobile. Inside an…
Q: Examine the code snippet below, and indicate what are the parameters? int result = Sum(5,6,7); ..…
A: Parameter: A parameter is a named variable passed into a function. Parameter variables are used to…
Q: Java Program create a prog that will compute the final grade for a certain student and will display…
A: PROGRAM EXPLANATION: Import java.util package. Create the main class. Create the main method.…
Q: Write a program that will provide important statistics for the grades in a class. The program will…
A: Algorithm: 1. Input list. 2. Prompt the message to input 5 grade points 3. store floating-point…
Q: (python) Use the following function: def doubleNumber(number): number *= 2…
A: A function call is an expression containing the function name followed by the function call operator…
Q: #include int main () int TOTNUM, NUMBER, SUM, INDEX, PRODUCT; float AVERAGE; SUM - e; INDEX = e;…
A: We can change this C code by simply changing some variables and optimizing the lines of code, like…
Q: int x=22, y=17; if((x>30 || y<2)) cout<<"BAHRAIN"; else cout<<"MANAMA"; A MANAMA B BAHRAINMANAMA C.…
A: The given code is: int x=22, y=17 here x is not greater than 30 so first condition is false. y…
Q: Identify invalid variables names from the following lists. Justify your answer. i) Student name ii)…
A:
Q: QUESTION 6 Analyze these lines of code: public static int sum (int num1, int num2, int num3) answer…
A: c) num1, num2, num3
Q: Variables of type single occupy half the memory of variables of type double, but they have lower…
A: Variables of type single occupy half the memory of variables of type double, but they have lower…
Q: Analyze these lines of code: public static int sum (int num1, int num2, int num3) answer = sum(n1,…
A: An argument is referred to the values that are passed within a function when the function is called.…
Q: in the following code there is * #include #include int man() { int B=25; int *p; //b memory…
A: #include<iostream>#include<conio.h> int man(){ int B=25; int *p; //b memory…
Q: Activity 8.1. Write a Java program that will assign given data to variables. Compute and display…
A: Inputs will be User name, Present and Previous Readings The output will be entire details
Q: Identify invalid variables names from the following lists. Justify your answer. i) Student name…
A: The invalid keyword are as follows: double,student name,currency$,2number,3456. Below is the…
Q: 1. What does the following program print? А. #include int main ( void ) • { int x = 1; int y = 0;…
A:
Q: Why am I getting errors? Says "Index 0 out of bounds for length 0"
A: Question- The Error you are getting simply the array args is empty. You have not passed any value to…
Q: for (int value=3; pow (2, value) <=100; value++) cout << pow (2, value) << ": ";
A: CONCEPT: - pow function It is present in cmath library. It takes two arguments namely base and…
Q: The following program have syntax errors. Correct them. On each successive line, assume that any…
A: //Syntax errors in given codepublic class Exercise25{static final char = STAR = '*' //two…
Q: The correct with respect to the size of the data types? a) char > int float c) char < int < float…
A: Below is the correct answer:
Q: Create an iterator that returns numbers, starting with 1, and each sequence will increase by one…
A: here in the given question ask for a program in python ,in that requirement is create an iterator…
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 4 images
- (Data processing) A bank’s customer records are to be stored in a file and read into a set of arrays so that a customer’s record can be accessed randomly by account number. Create the file by entering five customer records, with each record consisting of an integer account number (starting with account number 1000), a first name (maximum of 10 characters), a last name (maximum of 15 characters), and a double-precision number for the account balance. After the file is created, write a C++ program that requests a user-input account number and displays the corresponding name and account balance from the file.Create union floating point with members float f, double d and long double x. Write a program that inputs values of type float, double and long double and stores the values in union variables of type union floating point. Each union variable should be printed as a float, a double and a long double. Kindly check if the values always print correctly?my_round(number, integer): Based on the built-in round(...) function. Takes an integer or float and returns a rounded float value that is the number rounded to the second argument's decimal place. First argument can be any float or integer. Second argument must be an integer. Examples: my_round(1234.5678, 2) and round(1234.5678, 2) should return 1234.57. my_round(1234.5678, -2) and round(1234.5678, -2) should return 1200.0.
- Question 1 is already done need help with the others though This is the C code I have so far #include <stdio.h> #include <stdlib.h> struct employees { char name[20]; int ssn[9]; int yearBorn, salary; }; struct employees **emps = new employees()[10]; //Added new statement ---- bartleby // function to read the employee data from the user void readEmployee(struct employees *emp) { printf("Enter name: "); gets(emp->name); printf("Enter ssn: "); for(int i =0; i <9; i++) scanf("%d", &emp->ssn[i]); printf("Enter birth year: "); scanf("%d", &emp->yearBorn); printf("Enter salary: "); scanf("%d", &emp->salary); } // function to create a pointer of employee type struct employees *createEmployee() { // creating the pointer struct employees *emp = malloc(sizeof(struct employees)); // function to read the data readEmployee(emp); // returning the data return emp; } // function to…I need help In C This program calculates and prints the total grades for students out of 100; then, it prints the number of students who got A’s, B’s, C’s, D’s, and F’s. This program must implement the following functions: double get_total(double grades[], int size); This function receives a list of grades in the grades[] array and its size in the variable size. This function must calculate the total of the grades in grades[]. However, the function must drop the lowest quiz grade before calculating the total. Each grades[] list has the following elements order: {[Lab Exam/20] [Quiz 1/5] [Quiz 2/5] [Quiz 3/5] [Mid Exam/20] [Final Exam/50]}. The function will remove the lowest Quiz grade, and then it will precede to sum the rest of the grade. The total must not exceed 100. For example, if you pass 15, 5, 5, 3, 19, 46 to the function, the function will remove the three, and you will get 90. Another example, 17, 3, 1, 2, 17, 45, the function will return 84. char…C++ Create a class Student that contains three members: roll no, name and mark, and three functions. Write a first inputStudent() function to get data of student class. Write a second getMark() function that returns a student’s mark. Write a third display() function that displays a student’s data. In a main() function, you need to declare 40 students and get data of all students by using inputStudent() function. And also use a pointer array to keep all students by mark greater than 50 and display the searching data of each student in that pointer array (Use the access operator -> to access a pointer points to member functions of the Student class).
- (Sort three numbers) Write the following function to display three numbers in increasing order: def displaySortedNumbers(num1, num2, num3): Write a test program that prompts the user to enter three numbers and invokes the function to display them in increasing order. Here are some sample runs:Complete the program 'Bcast-Reduce-Assignment.c' (Refer to 'Bcast-Reduce-Example.c') to make the program have the output as follows if we run the program using 2 processes. The input sequence is: 0 1 2 3 The output sequence is: 0 2 6 12 The code below must be used, please #include <stdio.h>#include <stdlib.h>#include <mpi.h> int main(void) { int my_rank, comm_sz; int i; int Count = 4; int Number[4]; int Result[4]; MPI_Init(NULL, NULL); MPI_Comm_size(MPI_COMM_WORLD, &comm_sz); MPI_Comm_rank(MPI_COMM_WORLD, &my_rank); if(my_rank == 0) { printf("The input sequence is: \n"); for (i = 0; i < Count; i++) { Number[i] = i; printf("%d ", Number[i]); } printf("\n"); } // Process 0 sends data to all of the processes MPI_Bcast(Number, Count, MPI_INT, 0, MPI_COMM_WORLD); for (i = 0; i < Count; i++)…Q1. The circle has two data members, a Point representing the center of the circle and a float value representing the radius as shown below. typedef struct{ Point center; float radius;} Circle; typedef struct{ int x; int y;}Point; Implement the following functions:a. float distance (Line l1);- computes and returns the distance between the two points of the line.distance = sqrt((x2-x1)^2+(y2-y1)^2) b. float diameter(Circle circ);- computes the diameter of a circle.. .
- 6.10 LAB: Driving costs - functions Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats) as input, and output the gas cost for 10 miles, 50 miles, and 400 miles. Output each floating-point value with two digits after the decimal point, which can be achieved as follows:print('%0.2f' % your_value) Ex: If the input is: 20.0 3.1599 the output is: 1.58 7.90 63.20 Your program must define and call the following driving_cost() function. Given input parameters driven_miles, miles_per_gallon, and dollars_per_gallon, the function returns the dollar cost to drive those miles. Ex: If the function is called with: 50 20.0 3.1599 the function returns: 7.89975 def driving_cost(driven_miles, miles_per_gallon, dollars_per_gallon) Your program should call the function three times to determine the gas cost for 10 miles, 50 miles, and 400 miles. Note: This is a lab from a previous chapter that now requires the use of a function.5: CheckLetter.cpp) Write a program that adds a checkletter to an eight-digit number. The check letter should becomputed as follows: Break the number up into 4 two-digitnumbers. Add the four numbers together. Find theremainder after division by 26. The check letter is the letterin the alphabet that corresponds to the number justcomputed. (A=0, B=1, C=2, etc.) Print the original numberfollowed by the check letter. Use at least one ffunction thatreturns a value when you write this program.(Time in Seconds) Write a function that takes the time as three integer arguments (forhours, minutes, and seconds) and returns the number of seconds since the last time the clock “struck12.” Use this function to calculate the amount of time in seconds between two times, both of whichare within one 12-hour cycle of the clock