#include using namespace std; int main() { int i, j, space; space = 5-1; for(i=1; i<=5; i++) { for(j=1; j<=space; j++) cout<<" "; space--; for(j=1; j<=(2*i-1); j++) cout<<"*"; cout<
Q: 1. Write a readEmployee function that takes a pointer to an employee struct and fills in the…
A: #include <stdio.h> #include <stdlib.h> struct employees { char name[20]; int…
Q: What will happen when we compile and run the following code? #include using namespace std; int…
A: Please find the answer below :
Q: Please modify the C++ data structure program below to detect and display multiple candidates with…
A: Step 1 modify the C++ data structure program below to detect and display multiple candidates with…
Q: Although it will no longer be used, please leave the earlier global variable with the initialized…
A: Clarification:-Here I have made the capacity named readEmployee(), inside the capacity I have taken…
Q: Science P4.13The dew point temperature T. can be calculated (approximately) from the relative…
A: We have to write JAVA Code for following question:
Q: The annual percentage rate convention for calculating compound interest is as follows: The future…
A: //iostream for input output operations #include <iostream> //cmath for mathematical operaions…
Q: I keep getting these errors when I run the code below: Code is in C++ ____animal.cpp_______…
A: Answer: horsemain.cpp: #include "horse.h"#include<limits>#include<cstdlib> void…
Q: 1. execute the program in the background 2. obtain process status 3. show to the zombie child…
A: The Program referenced in the question Lab7.c ,creates a Zombie process. The program creates a…
Q: long mult2(long, long); void multstore(long x, long y, long *dest) long t = mult2(x, y); *dest = t;…
A: To do: Convert the given code
Q: Loco Burrito has hired you to develop a new food ordering system for its customers. Each customer…
A: Code in next step
Q: I have to add the following solution to a code. The chapter is focused on strings and string…
A: Program:month = ['placeHolder for 0','January', 'February', 'March', 'April', 'May', 'June', 'July',…
Q: Although it will no longer be used, please leave the earlier global variable with the initialized…
A: Here I have created a function named readEmployee(). In this function, I have taken input from the…
Q: I am trying to add Windows using setfill(":") and after the code run it is not displaying these…
A: Required: I am trying to add Windows using setfill(":") and after the code run it is not displaying…
Q: QUESTION 10 def cube (number): for i in range (number, number): for j in range (number) : print…
A: In place of FILL THIS PART just write number*number*number Hence the answer to be filled in the box…
Q: In C++, create a program which will read a phrase from the user and create a framed version of it…
A: Actually, c++ is a powerful general purpose language.
Q: Hi, i have a problem with this code, which is it only takes the last scores entered by the user when…
A: After correcting the code, I have provided C++ CODE along with 2 OUTPUT…
Q: 5.A)For the code segment below, what should be the values for q will result in kiwi being included…
A: A switch case is like a if-else-if ladder. When the value of variable to be switched matches any…
Q: QUESTION 12 Multiple Choice: What is the output of the code below? public static void main(String]…
A: Question 12: class HelloWorld { public static void main(String[] args) { String str…
Q: I need to make this code modular. Apparently I've done this wrong, so any way I could get advice…
A: I give the modular code after modifying your code with the correct output screenshot
Q: Although it will no longer be used, please leave the earlier global variable with the initialized…
A: Memory Layout of C Programs A typical memory representation of a C program consists of the…
Q: please code in python You are probably familiar with the famous Fibonacci sequence of numbers,…
A: The question is to write the recursive python code for the given problem.
Q: /I need help debugging the C code below the image is what I was following for directions while doing…
A: The Above Code is Debug Success full:
Q: Yahtzee program.
A: I have solved that program before , I am providing the overall coding. You can use my code. The…
Q: To create a constant variable in Java, use O immutable. O const. O final. constant.
A: To declare constant variable in java
Q: ger, print out, the string "bad value(s) in:" followed by the names of the variables that have bad…
A: As not specified I have solved the question using Python language Code: x = input("Enter value for…
Q: This assignment is to modify the rock-paper-scissors game f. As before, each of two players enters…
A: Program Approach Create an enum variable Choice with the three keys ROCK, PAPER, and SCISSORS with…
Q: Three-letter acronyms are common in the business world. For example, in Java you use the IDE…
A: import java.util.*; public class ThreeLetterAcronym{ public static void main(String[] args) {…
Q: Three variables, x, y, and z, supposedly hold strings of digits, suitable for converting to…
A: Below is the required python program: - Approach: - Ask the user to enter the value of x, y, and z.…
Q: Drewa flowchart for a program for Huntersville College. The current tuition is $20,000 per year, and…
A: Actually, program is a executable software that runs on a computer.
Q: What will be the value of variable "c", when the following code is int c=0; for (int d = 1; d 3) {…
A: 1) Code and output with explanation: #include <iostream>using namespace std;int main(){ int…
Q: how do you complete a function that returns more than one value? we were kind of taught it but i'm…
A: Given prototype float minMax (float* array, int size, float* min, float* max); Here other than array…
Q: b- Write a program that allows the user to enter coordinates of circle center and radius then asks…
A: Given: Write a program that allows the user to enter coordinates of circle center and radius then…
Q: Translate the following boolean assignment X:= y >z into intermediate code assuming Ex, Nx, and Cx…
A: Your solution is below please check CJUMP(GT, TEMP(y), TEMP(z), L1, L2) LABEL(L1) MOVE(TEMP(x),…
Q: By using Loop in c++, you are responsible to develop a Credit Limit Calculator, which will determine…
A: Find Your Code Below
Q: [Python (py3)] Displayed below is a code for matrix addition. However, there is an error that…
A: Here inside the loop, while adding the row to the matrix, I have removed the axis parameter and all…
Q: In C, Assume that the int variables i and j have been declared, and that n has been declared and…
A: The C program and its approach to print a triangle of asterisks are given below: - Approach: -…
Q: The result of the following program is: #include void main() { int a, b, c, x; a=6, b=1, c=8;…
A: The current scenario here is to find the output for the following c++ program.. Program: #include…
Q: 2. Write a program that automates the table used by a surveyor to transform compass headings in…
A: Note: This code should be rewritten instead of copying to the compiler otherwise it will throw a…
Q: Will the following code display the larger of the two values? Answer the question and explain your…
A: Given program: #include <iostream>using namespace std; void find_larger(int v1,int v2, int…
Q: 1. Write a program to let the user choose from the following list and solve for the solution. Write…
A: Welcome!. Choose what you want to solve1. AREA2. PERIMETER1Choose from the following1. Area of the…
Q: Tests that FindText() returns 5 for parameters "more" and "We'll continue our quest in space. There…
A: Here I'm attaching the whole working code: find text was not implmented #include<iostream>…
Q: //I need help debugging the C code below the image is what I was following for directions while…
A: SUMMARY: - Hence, we discussed all the points.
Q: Give DETAILED EXPLANATION about how this code works. Also, show output of the program while pointing…
A: #include <stdio.h>#include <string.h>#include <stdlib.h>#include <iostream>…
Q: The Goal of this project is to write a program in C++that calculates car rental amounts (for an…
A: - The question is to code the given scenario of hours.
Q: Write a program that computes the number of extraterrestrial civilizations capable of communicating…
A: Note :- You have not mention the language of the program so. i'm answering your question in C++…
Q: Please modify the C++ data structure program below to detect and display multiple candidates with…
A: modify the C++ data structure program below to detect and display multiple candidates with the same…
Q: c++ program to find min and max
A: You can Use following code:- #include <iostream> using namespace std; void getMinMax(int…
Q: Hello, I have an assignment in the python program. Professor gives me a text like this: January.txt…
A: Python program to generate the January Bank Statement. customer’s account number, beginning balance,…
Q: Examine the following code segment. What will be printed? If there are any errors indicate the…
A: Identify the errors in the program: (i) Syntax error: Variable "i" is not declared. (ii)Syntax…
Please help me create a flow chart for this code. Thank you so much!
Code:
#include<iostream>
using namespace std;
int main()
{
int i, j, space;
space = 5-1;
for(i=1; i<=5; i++)
{
for(j=1; j<=space; j++)
cout<<" ";
space--;
for(j=1; j<=(2*i-1); j++)
cout<<"*";
cout<<endl;
}
space = 1;
for(i=1; i<=(5-1); i++)
{
for(j=1; j<=space; j++)
cout<<" ";
space++;
for(j=1; j<=(2*(5-i)-1); j++)
cout<<"*";
cout<<endl;
}
cout<<endl;
return 0;
}
Step by step
Solved in 4 steps with 3 images
- In this problem you will calculate the area of a house and compare it with another house to see which one is bigger. House1 vs. House2 We need to have a struct that has width and length in it. This struct represents a rectangular room. From room we need to define: Bathroom, Livingroom, Bedroom and Kitchen. An example of the struct and Bathroom, Livingroom, Bedroom and Kitchen is shown below. Also, it is shown how to set value of Bathroom Length and Width- values are assumed in feet. House area is in Square Feet (sqrft) and can be calculated by adding all room areas together in sqrft. Program example: Struct room { Length; Width: }; Struct room Bathroom1 , Livingroom1, Kitchen1, Bedroom1; Bathroom1.Length=10; Bathroom1.Width=7; Now Given: House1 is comprised of: Bedroom1 (L=15,W=10) Bathroom1 (L=10,W=7) Kitchen1(L=15, W= 10) Livingroom1 (L=25,W=20) House2 is comprised of: Bedroom2_1 (L=10, W=10) Bedroom2_2(L=10, W=12) Kitchen2(L=16,W=10) Livingroom2 (L=15,W=12) Calculate each House area…Within the tutorial casino craps game pseudocode, where should you place the pseudocode that performs the task of 'Get if the player won or lost', and how (in pseudocode) should this task be implemented? a.) In Function play, with pseudocode function play() ... set a local variable to won or lost b.) In Function play, with pseudocode function play() ... return if the player won or lost c.) In Loop until Games Played = Times to Play, with pseudocode Loop until Games Played = Times to Play ... If the player won ... Set "Get if the player won or lost" to won Else if player lost ... Set "Get if the player won or lost" to lost d.) In Loop until Games Played = Times to Play, with pseudocode Loop until Games Played = Times to Play ... If the player won ... Else if player lost ... Set "Get if the player won or lost" to won or lostThis assignment is not graded, I just need to understand how to do it. Please help, thank you! Language: C++ Given: Main.cpp #include #include "Shape.h" using namespace std; void main() { /////// Untouchable Block #1 ////////// Shape* shape; /////// End of Untouchable Block #1 ////////// /////// Untouchable Block #2 ////////// if (shape == nullptr) { cout << "What shape is this?! Good bye!"; return; } cout << "The perimeter of your " << shape->getShapeName() << ": " << shape->getPerimeter() << endl; cout << "The area of your " << shape->getShapeName() << ": " << shape->getArea() << endl; /////// End of Untouchable Block #2 //////////} Shape.cpp string Shape::getShapeName() { switch (mShapeType) { case ShapeType::CIRCLE: return "circle"; case ShapeType::SQUARE: return "square"; case ShapeType::RECTANGLE: return "rectangle"; case…
- I asked for this to be written in c# instead I got C. Please create a console application of your choice with the given requirements in C#. The application project should cover the following areas below. Please pay attention to the requirements below, specifically number 4. Please use parallel arrays and range matches for this application. 1. Declare variables with proper data types2. Be able to use decision-making structure3. Be able to use a loop structure4. Be able to use arrays to handle a list of items (e.g. use a loop to get user input, and assign thevalue to an array, search an array to perform certain operations, use parallel arrays and rangematches, etc.)5. Be able to implement and use method .Problem Description: The international standard letter/number mapping found on the telephone keypad is shown below: Write a pseudocode and program that reads a letter and displays its corresponding digit. 2 3 1 ABC DEF 4 5 6 GHI JKL MNO 7 8 9 PQRS TUV WXYZ 0 Write a pseudocode on how you would solve the problem in your own word. Write a java program called Phone considering the following directions. Practice here first then write answer on the answer sheet. Also, make sure distinguish high and low caps as Java is case – sensitive. Import and declare a Scanner class Ask user for an Upper – case letter Use the switch statement along with case and break Use the System.exit(1) in the default to terminate the program Print the corresponding digit//I need help debugging the C code below the image is what I was following for directions while doing the code// #include <stdio.h> #include <stdlib.h> struct employees { char name[20]; int ssn[9]; int yearBorn, salary; }; // 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 print the employee data to console void display(struct…
- 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);…Write a code for craps game. Craps is a dice game in which the players make wagerson the outcome of the roll, or a series of rolls, of a pair of dice.The rules of the dice game craps are as follows:You roll two dice. Each die has six faces, which contain one, two, three, four, five and six spots,respectively. After the dice have come to rest, the sum of the spots on the two upward faces iscalculated. If the sum is 7 or 11 on the first throw, you win and play is over. If the sum is 2, 3or 12 on the first throw you lose and play is over. If the sum is 4, 5, 6, 8, 9 or 10 on the firstthrow, that sum becomes your “point.” To win, you must continue rolling the dice until you“make your point” (i.e., roll that same point value). You lose by rolling a 7 before making yourpoint(in python)Write a code for craps game. Craps is a dice game in which the players make wagerson the outcome of the roll, or a series of rolls, of a pair of dice.The rules of the dice game craps are as follows:You roll two dice. Each die has six faces, which contain one, two, three, four, five and six spots,respectively. After the dice have come to rest, the sum of the spots on the two upward faces iscalculated. If the sum is 7 or 11 on the first throw, you win and play is over. If the sum is 2, 3or 12 on the first throw you lose and play is over. If the sum is 4, 5, 6, 8, 9 or 10 on the firstthrow, that sum becomes your “point.” To win, you must continue rolling the dice until you“make your point” (i.e., roll that same point value). You lose by rolling a 7 before making yourpoint.
- IN PYTHON PLEASE AND FLOWCHART DRAWING COPUTERIZED PLEASE!! In many businesses across the country, people are buying food and goods using cash. Whenever a purchase is made with cash, it is usual that change must be back to the customer. Business point of sales software help to ensure that the correct change is return to a customer by providing detailed information of the change that should be returned to the customer. using the fewest number of bills and coins. In this assignment, you are asked to design and implement a program that writes out what bills (ones, fives, tens, twenties) and coins (pennies, nickels, dimes, and quarters) that should be returned to the customer given two inputs from the user: A total cost of a sale. The amount that was paid by the customer. Ensure that your output is grammatically correct. If the customer does not provide adequate payment, you should print the following statement, the program should end. Did not receive enough cash from the customer.…The Assignment Loco Burrito has hired you to develop a new food ordering system for its customers. Each customer will type in a code representing the structure of his or her order, and your program will display (to standard output) a summary of the order components along with the total cost. An order code is exactly nine characters long, representing five required items and four optional toppings. The order code positions, from left to right, represent the following elements: Five required items: 1. 'A' represents a burrito ($3.00), and 'B' represents a burrito bowl ($4.00). 2. 1 represents black beans (no additional charge), and 2 represents pinto beans (no additional charge). 3. 1 represents white rice (no additional charge), and 2 represents brown rice ($0.50 extra). 4. 1 represents chicken ($2.00 additional), 2 represents carnitas ($2.50 additional), and 3 represents steak ($3.50 additional). 5. 1 represents mild salsa (no additional charge), 2 represents medium salsa (no…Assignment Description This program will simulate part of the game of Yahtzee! This is a dice game that involves rolling five dice and scoring points based on what show up on those five dice. The players would record their scores on a score card, and then total them up, and the player with the larger total wins the game. A Yahtzee score card has two portions: The upper portion has spaces for six scores, obtained by adding up all of the 1's, 2's, 3's, etc. The lower portion has special scores for various combinations: Three of a kind -- at least 3 dice are the same number;the score is the sum of all five dice Four of a kind -- at least 4 dice are the same number;the score is the sum of all five dice Small straight -- four consecutive numbers are represented, e.g. 2345;the score is 25 points Large straight -- five consecutive numbers are represented, e.g. 23456;the score is 30 points Full House -- three of one kind, two of another; the score is 30 points Yahtzee! -- five of a kind; the…