Write a C++ program that reads the information from the user to enter the name of the candidate, the total number of received votes, and the spoilt votes in a local election. The total number of participants (candidates) are 5. If the user mistakenly enters any negative value, the program should consider that value as a positive integer. The program should output the name, total received votes, and the percentage of obtained votes by the winning candidate. The program should also display the percentage of the spoilt votes.
Q: Write a C program to calculate Gross Salary of an employee. Here’s simple program to calculate Gross…
A: HI THEREI AM ADDING C CODE AS PER ABOVE REQUIREMENT BELOWPLEASE GO THROUGH IT THANK YOU
Q: Write a program in C++ to count total number of notes in given amount
A: Given: Write a program in C++ to count total number of notes in given amount.
Q: Write a program in C++ so that when you write any number starting from 1 to 12, the Gregorian month…
A: Step-1: Start Step-2: Declare a variable n Step-3: Input a number and store in n Step-4: Switch…
Q: A. write a c++ program that asks the user to enter values for dollar and convert into peso. display…
A: ANSWER:-
Q: Write a C program using if-else. The program reads one integer number k. Then it reads one real…
A: Inside if, check the value of k whether it is either 4 or 5 So, n is represented as n = 3f-67π
Q: 7. Write a C++ program that calculates and prints the bill for a car rental company. The company…
A: C++ Program for above : #include <bits/stdc++.h> using namespace std; //function to…
Q: Write a program in C to calculate and print the Electricity bill of a given customer. The customer…
A: #include<iostream>using namespace std;int main(){ int customer_id, units; string name;…
Q: Write a C++ program that reads the information from the user to enter the name of the candidate, the…
A: Include the required headers. Declare the main function. Declare all the required variables. Prompt…
Q: Write a progarm in C compiler that inputs three variable from the user of type: int, float and char.…
A: Please find the answer below :
Q: Write a program in C# that will ask the user to enter two double numbers. Use an if() statement to…
A: Program plan: Ask the user to enter the first number. Ask the user to enter the second number. Use…
Q: A chemical sensor works to read the value of pollution in four industrial sites every four hours a…
A: Required: write a program in C ++ language that works to read the pollution values in those sites…
Q: Write a c++ program Write a program that ask sthe user to enter the value of four angles (in…
A: #include<iostream> // It is "iostream" is C++ standard library which helps to implement…
Q: Write a C++ program that calculates the Perimeter of a circle. The main function asks the user to…
A: C++ is one of the most popular programming languages developed by Stroustrup at Bell Labs. The basic…
Q: Write a C++ program that calculates and prints the monthly paycheck for an employee. The net pay is…
A: Find the required code in C++ given as below and output:
Q: C++ program that prompts the user to enter the number of items and each item’s name and price, and…
A: Write a C++ program that prompts the user to enter the number of items and each item’s name and…
Q: Write a C++ function: int rectArea (int len, int wid) that returns the area of a rectangle with…
A: Algorithm 1. Start 2. Var Len, wid, area 3. Accept len and wid from user 4. Area=rectArea (len, wid)…
Q: Write a C++ program that allows the user to enter the last names of five candidates in a local…
A: Introduction of the Program: The C++ program takes 5 candidates names and votes from the user and…
Q: Write a program in C++ that asks the user how many numbers she would like to compare; Then accepts…
A: The following algorithm is required for writing the program to find the smallest, largest from given…
Q: Write C program that calculates the volume and the surface area of a writ write a c program that…
A: When we consider a C program, it can be defined as a collection of objects that communicate via…
Q: Write a C++ program that computes the rental fees of N cars; N is the first input by the user. For…
A: The problem is based on the basics of C++ programming language.
Q: Write a program in C that asks the user to enter a number of seconds and works as follows: • There…
A: Here we are given user input in seconds. We need to convert it into days, hours , minutes, seconds.…
Q: In this part, you are asked to write a C-program that makes change for amounts less than one dollar.…
A: I have created an infinite while loop. Next, inside the loop, I have taken input from the user and…
Q: Write a program in C++ to calculate and print the Electricity bill of a given customer. The customer…
A: EXPLANATION: Include the necessary header files. Create a function that will take the user input…
Q: Write a program in C++ which adds, subtracts, multiplies, divides, and perform exponentiation on two…
A: Algorithm: Start Select the operation to be performed Read two numbers a,b If user selected…
Q: In C++ Write a program with a car's miles/gallon and gas dollars/gallon (both doubles) as input, and…
A: Here I have taken input from the user. Then I have calculated the cost in dollars for 20, 75, and…
Q: Write a c++ program that allows the user to enter the last names of five candidates in a local…
A: Algorithm: 1. Declare array names as name[5] and array votes as votes[5]. 2. Initialize winner index…
Q: Write a program in C# that will compute how much money a user has in coins. Your program should…
A: As we are dealing with currencies, the standard formatting is 2 decimal
Q: Illustrate your knowledge of C-Programming by implementing a ‘Game of Dice’. User will start with 3…
A: The program is written in C programming language using structured approach. The program uses…
Q: Write a program in C++ that prompts the user to enter five test scores
A: Actually. program is a executable software that runs on a computer.
Q: Write a C++ program to automate the Grocery shop bill for 6 items. The program asks the grocery shop…
A: In the c++ program, add the necessary libraries in the program. To help the program to run without…
Q: Write a program in C++ to calculate and print the Electricity bill of a given customer. The customer…
A: The below given C++ program will obey the following rubrics: Including necessary header files. In…
Q: The programming language is C++, write a program base on the given statement. Write a program that…
A: #include <iostream> using namespace std; // Defininig the main functionint main(){ //…
Q: Write a C++ program that requests the user to enter a letter or a digit. Use if-statements and the…
A: The program will take the input character and stores into a variable. It uses IF ELSE condition to…
Q: Write a C++ program that reads the information from the user to enter the name of the candidate, the…
A: Write a program for election voting system. C++ code :- #include <iostream> using namespace…
Q: In your C compiler: 1. Given two numbers X and Y. Write a program to determine the difference…
A: #include <stdio.h>int main(){ //1 int X,Y,R; //reading X,Y value from user…
Q: Write a complete C++ program that calculate a patient's treatment charge based on the types of…
A: C++ code for the requirement: #include <iostream>using namespace std; float…
Q: Write a program in C that asks the user to insert the temperature value in Celsius (°C). The program…
A: Algorithm: Start Read temperature in Celsius Calculate fahrenheit=(celsius*9/5)+32 Print fahrenheit…
Q: write a simple c++ program that calculates the amount of money earned on an investment, based on an…
A: Please find the answer below :
Q: Write a complete C++ program that: A wholesale furniture store that sells tables in bulk needs a…
A: In this program, all parts are calculated including the third one. Here I have taken input from the…
Q: In C++ using endl; Write a program that can be used to calculate the federal tax. The tax is…
A: Program: #include <iostream> using namespace std; //function getData void getData(char…
Q: Write a C++ program that will repeatedly ask the user to enter an integer quantity of liquid given…
A: Program Explanation: The header file “<iostream>” is declared that contains all standard…
Q: Develop a C++ program that asks the user to enter a number. If the user enters 1, the program…
A: Start Input ch If ch is 1, Input N, Calculate and print S1 If ch is 2, Input N, Calculate and print…
Q: Write a C program that will calculate the total payment for a brand new car being purchased on…
A: C program: C is a programming language developed by Dennis Ritchie at AT & T Bell Laboratory in…
Q: Q1) Write a C++ program which determines the weather according to the temperature as follow:…
A: #include <iostream>using namespace std;int main(){ int t; cout<<"Enter the…
Q: In C++ Write a program whose input is a character and a string, and whose output indicates the…
A: #include<iostream>#include<string> using namespace std; // function to print number of…
Q: You are required to write a C++ program to determine the number of students based on their weight…
A: Algorithm Start Var w[100], n, rang[5]={0, 0,0,0,0} Accept number of students from user For i=0 to…
Q: Q1. Write a program in C++ language to obtain the equation below, for values of x from (1- 20), by…
A: C++ Code :- #include <iostream>#include <cmath> using namespace std; int main(){…
Q: 7. Write a C++ program that calculates and prints the bill for a car rental company. The company…
A: #include<iostream>using namespace std;int main(){ char type;…
Q: are as follow: Unit Charge/unit upto 199 @1.20 200 and above but less than 400 @1.45 400…
A: EXPLANATION Read the input using readline(); Use if-else if statement to implement all the…
Q: In C++, Write a program that asks the user to enter two numbers, obtains the two numbers from the…
A: The Answer is in Below steps
Step by step
Solved in 4 steps with 2 images
- Read problem carefully. • Solve problem using 5-steps of Engineering Problem Solving Methodology (including algorithm) Draw flowchart diagram Write a C++ program Problem Statement: An election is a formal group decision-making process by which a population chooses a candidate by casting votes. Each candidate is assigned name and a specific symbol. A ballot paper is used to cast the vote. Each ballot paper contains symbols of the candidate. A person can vote a candidate by stamping on a specific symbol. The ballot paper should be considered as a spoilt ballot if a person does not stamp or stamp on more than one symbol. Finally ballot paper has to be dropped in a ballot box. Write a C++ program that reads the information from the user to enter the name of the candidate, the total number of received votes, and the spoilt votes in a local election. The total number of participants (candidates) are 5. If the user mistakenly enters any negative value, the program should consider that value…Design Blackjack Card-Game in C Rules: The player is dealt two cards, face up. The dealer is also dealt two cards, one up (exposed) and one down (hidden). The value of cards two through ten is their pip value (2 through 10). Face cards (Jack, Queen, and King) are all worth ten. Aces can be worth one or eleven. A hand's value is the sum of the card values. The player is allowed to draw additional cards to improve his hand. A hand with an ace valued as 11 is called "soft", meaning that the hand will not bust by taking an additional card. The value of the ace will become one to prevent the hand from exceeding 21. Otherwise, the hand is called "hard". Once the player has completed his hand, it is the dealer's turn. The dealer hand will not be completed if all players have either busted or received blackjacks. The dealer then reveals the hidden card and must hit until the cards total up to 17 points. At 17 points or higher the dealer must stay. You are betting that you have a better…Question IV: ER Modeling A social recreation club has a system to keep track of club members, committees and activities. Each club has a registration number and a title. Several members form committee. Members are male and females. Each committee has a name, a unique number and a date, which the committee has formed. The system stores the members’ unique identification number, name, address, gender, birth date and club joining date. The club forms committees for different activities. A committee controls and organizes a number of activities, each of which has a unique name, a unique number and description of the event. An event has event ID and description of the event. An activity may consist of several events. Committee publishes many online advertisements about the activities. Advertisement details are ID and a title. Draw the ER diagram to represent the above scenario
- UML Design for Turing Machine Description: An electro-mechanical device used by the British cryptologists to help decipher German Enigma-machine-encrypted secret messages during World War II. A Turing Machine is a very simple abstract model of computation. The machine has an infinite tape that is divided into cells (or squares). Each cell contains a symbol (or character) chosen from some small set of possible symbols. Most of the cells are blank, that is, they contain the blank symbol. The number of non-blank cells is finite. The machine is located on one of the cells, and it can only "see" the symbol in the cell where it is located. It can write a new value to that cell. It can move left or right on the tape, one cell at a time. The machine is in one of a fixed, finite number of possible states. One of the states is the halt state. A Turing Machine has a table of rules. The table of rules is the program for the machine. A rule tells the machine what action to take when it is in a…Develop problem-solving skills that generate idea creation, and apply them to everyday personal and professional experience. Instructions A syllogism is a type of logical argument that uses deductive reasoning to come to a conclusion. There are many types, but for this task, you will use a categorical syllogism. Categorical syllogisms: This type of syllogism assumes if A is a part of C, then B is a part of C (A and B are members of C). You can organize the syllogism in three sentences: 1. Your employer wants to promote a productive and logical work environment. To organize your thoughts and ideas in a coherent manner, you must practice your cognitive skills on a daily basis. To practice the process of creative problem solving, your boss has asked you to create two categorical syllogisms about a hypothetical everyday problem. For example, you are regularly late for work. 2. For your third and final syllogism, your boss wants you to introduce a new minor premise that would provide…C++ programming It has been observed by management that some faculty member at the university demonstrates a lackadaisical attitude toward work. They seldom go to class yet at the end of each month they receive full salary. Management has decided that GHs 200, 300, 400, and 500 will be deducted from a faculty’s salary if he/she offends once, twice, third time and forth time respectively in a month. This means that if a faculty member offends once in a month GHs 200 will be deducted, if a faculty member offends twice in a month, GHs 500 (i.e. 200+300) will be deducted, if a faculty member offends three times in a month GHs 900 (i.e.200+300+400), will be deducted and if a faculty member offends four times in a month GHs 1,400 (i.e. 200+300+400+500). Assuming all faculty members are on a flat salary rate of GHs 2500. a. Write a program to request for the names of four faculty members and number times he/she has absented him/herself from class. One of them should have absented him/herself…
- Direction Fields Plotting Direction fields can be done using the function quiver: quiver Quiver plot. quiver (X,Y.U.V) plots velocity vectors as arrows with components (u.v) at the points (x,y). The matrices X,Y,U,V must all be the same size and contain corresponding position and velocity components (X and Y can also be vectors to specify a uniform grid). quiver automatically scales the arrows to fit within the grid. Example: xrange = -5:0.5:5; %the domain of x is from -5 up to 5 with 0.5 interval. yrange= -10:1:10; %the values of y is from -10 up to 10 with 1 interval. [x,y] meshgrid(xrange,yrange); Xplot the DE y = x^2+y^2; S = x.^2+y^2; quiver (x,y,ones (size(s)),s) Exercises: Sketch the direction fields of the following differential equations 1. y = 0.25xy² 2. y = sin(x-y) Notes: For the ranges: For Item No.1 Use xr1 = (-5,5) with 0.5 interval yr1 = (-10,10) with 0.5 interval Use s1 for the f(x,y). x1 and y1 as the points in the rectangular coordinate system, For Item No.2 Use xr2…C Programming Language (Code With C Programming Language) Problem Title : Visible Trees There is a legend about a magical park with N × N trees. The trees are positioned in a square grid with N rows (numbered from 1 to N from north to south) and N columns (numbered from 1 to N from west to east). The height (in metres) of each tree is an integer between 1 and N × N, inclusive. Magically, the height of all trees is unique. Bunga is standing on the northmost point of the park and wants to count the number of visible trees for each Column. Similarly, Lestari is standing on the westmost point of the park and wants to count the number of visible trees for each Row. A tree X is visible if all other trees in front of the tree X are shorter than the tree X. For example, let N = 3 and the height (in metres) of the trees are as follows6 1 87 5 32 9 4 On the first column, Bunga can see two trees, as the tree on the third row is obstructed by the other trees. On the second column, Bunga can see…JAVA LANGUAGE Body Mass Index Version 2.0 by CodeChum Admin Recall that according to the National Heart, Lung, and Blood Institute of the National Institutes of Health, body mass index (BMI) is a measure of body fat based on height and weight that applies to adult men and women. It is used to monitor one's health by determining whether one is underweight, overweight, has normal weight or is obese. It is computed based as follows (when using standard weight in pounds and height in inches): BMI = 703 x (weight/(height2)) Furthermore, people with BMI scores that are less than 18.5 are said to be underweight. Those with scores between 18.5–24.9 (inclusive) are of normal weight. Those with scores between 25–29.9 (inclusive) are said to be overweight. And those with scores 30 or higher are obese. Input The input is composed of two positive integers representing the weight in pounds and the height in inches. 140·65 Output A single line containing two values: the computed…
- PLEASE CODE IN PYTHON Problem Description An anagram is a word or a phrase formed by rearranging the letters of another phrase such as “ITEM” and “TIME”. Anagrams may be several words long such as “CS AT WATERLOO” and “COOL AS WET ART”. Note that two phrases may be anagrams of each other even if each phrase has a different number of words (as in the previous example). Write a program to determine if two phrases are anagrams of each other. Input Specifications The input for the program will come from an input file in.dat, in.dat will have two lines of data, line (1) will have the first phrase and the line(2) will have the second phrase. You may assume that the input only contains upper case letters and spaces. Output Specifications The program will print out one of two statements: ”Is an anagram.” or, ”Is not an anagram.” All output will be to the screen. Sample Input CS AT WATERLOO COOL AS WET ART Output for Sample Input Is an anagram.CODING LANGUAGE: R (similar to python) R is a programming language for statistical computing and graphics supported by the R Core Team and the R Foundation for Statistical Computing. The Behdel TestThe Bechdel test asks whether a work of fiction features at least two women who talk to each otherabout something other than a man, and there must be two women named characters.In this mini analysis we work with the data used in the FiveThirtyEight story titled:"The Dollar-And-Cents Case Against Hollywood's Exclusion of Women"https://fivethirtyeight.com/features/the-dollar-and-cents-case-against-hollywoods-exclusion-of-women/Start with loading the packages: fivethirtyeight, tidyverse1. What information does this dataset contain? What commands did you use to see this?For our purposes of analysis we will focus our analysis on movies released between 1990 and 2013.bechdel90_13 <- bechdel %>%filter(between(year, 1990, 2013))2. How many movies are in our filtered data set?The…Language : C Jojo remembered going to a cave with his best friend Lili before the coronavirus pandemic.There, he saw several Stalactites hanging from the /cave’s ceiling. Stalactite is a type offormation that hangs from the ceiling of caves.Jojo noticed an interesting fact about the stalactites. The stalactite formation in thiscave forms a pattern. He wonders how will the formation look like if the cave is of adifferent size. He has asked your help to visualize this formation. Format Input :A single line with an integer N denoting the size of the cave Format Output :A size N formation of stalactites. Do not print extra spaces behind the last ‘*’ character in each line. Constraints : • 1 ≤ N ≤ 12 Sample Input 1 :2 Sample Output 1*** *Sample Input 2 :3 Sample Output 2 :******* * * * *