What are the values of x and y inside the main function at /*values here */ in the following code assume all proper header files included void hello (int *x); int main(void) { int x,y; x=35; y=14; hello(&x); hello(&y); /* values here */ } void hello (int *x) { int y; y=*x + 2; *x = 2 * *x; }
Q: Q2/ Choose True or False: 1. C++ program structure is divided into four sections. a) True b) False…
A: There are some questions given on C++ which are either true or false. The correct options are given…
Q: (25 min) The following table shows the foreign exchange rates for a few currencies. Foreign Currency…
A: Step 1 : Start Step 2 : Print the Currency Exchange Rate Table. Step 3 : Take user input of the…
Q: [Question Description] Write a function to find the factorial using the formula n!=1*2*3*...*n, such…
A: There were no restriction stated hence made this way. Screenshot is also attached.
Q: in c++ Write a program to generate a random number between 1 - 100, and then display which quartile…
A: This question explains about C++ program Program Guidelines: Utilize the header records,…
Q: Language: C++ Consider the abs function, which determines the absolute values of a real number. The…
A: #include<iostream> using namespace std; int abs(int a) { if (a<0) return…
Q: TABLE: Days of the week Day: Sunday Monday Tuesday Wednesday Thursday Friday Saturday Code: 1 2 3 4…
A: Algorithm: Start. Check if x and y are greater than 7 or less then zero, print invalid codes. Else,…
Q: AQ2. Write a C program to display the hour glass shape on the screen using the function named…
A: The Given Question requires to print the Given HourGlass Pattern using '*' for n number of Rows.…
Q: Ameba Couture is an online clothing wholesaler. In Ameba Couture, members will get a discount based…
A: Algorithm: 1. Create getDiscount function and return all credit points. 2. Create calPayment…
Q: Code in C++ language The area of an arbitrary triangle can be computed using the formula area =…
A: The variables a and p, to compute area and perimeter respectively, passed by reference. In call by…
Q: in c++ structure to store the name, account number, and balance of customers (more than 10) and…
A: Actually, program is an executable software that runs on a computer.
Q: main () program Is given below and you are asked to write the function definitions in the space…
A: The instructions are provided by the programmer according to the requirement using the programming…
Q: ВВBBB BBBB Q2) write a C++ program to generate the following pattern using the functions…
A: The question ask to print the following pattern such that the character and space computation should…
Q: Create a C program for a Coffee shop business. The system can do the following task and the…
A: Create a C program for a Coffee shop business. The system can do the following task and the…
Q: 1. Design a C++ program named (permu_combi.cpp), that presents a menu to select to calculate…
A: C++ used to answer this question
Q: Section 2: Program Design 2 Write a C++ program that calculate the area of a circle. • Circle area's…
A: Language is one of the most widely used programming language which has been used to create different…
Q: Exercise 1-Square natural numbers Exercise Objectives Using built in functions Problem Description…
A: Algorithm: Start Read number n Initialize sum to 0 Iterate through the loop from i=1 to i=n…
Q: In C programming, write a function that accepts a character argument and returns 1 if the argument…
A:
Q: This is an computer programming question The code should be in C++ Create a namespace student…
A: #include <iostream>#include <iomanip> using namespace std; //Object oriented paradigm,…
Q: C code Blocks Write a function that accepts three floating point numbers and returns the average of…
A: To Do: Write a C program.
Q: C++ Programming: I need help writing a void function that prints sales per product per period using…
A: #include <iostream>#include <string>#include <iomanip> using namespace std; int…
Q: Define a function named swap_values that takes four integers as parameters and swaps the first with…
A: We need to correct the given Python code.
Q: C Programming Language Define an enumerated data type Month. Write a function that takes a Month…
A: 1) Below is C Program to define enumerated data type Month and a function that takes a Month…
Q: Write a function max_magnitude() with two integer input parameters that returns the largest…
A: Algorithm of function max_magnitude(user_val1, user_val2): 1. Check condition: 1.1. IF absolute…
Q: HUK computer store offers credit plan at 10% down payment and an annual interest rate of 12%. You…
A: The given is the programming problem that needs to be solved using C++. The user will be asked to…
Q: C++ Programming: I need help writing a void function that prints sales per product per location…
A: #include <iostream>#include <string>#include <iomanip> using namespace std; int…
Q: Define a function named swap_values that takes four integers as parameters and swaps the first with…
A: Swap is a function that directly swaps values between two given variables of the same types.
Q: PROBLEM Write a C++ Program to solve the following using functions a Convert Binary Numberto Decimal…
A: The code implementation is given in the steps below. The Algorithm: The separate functions are…
Q: Computer Science question Please write a program in Go Programming LanguageWrite a program to assign…
A: Required: Please write a program in Go Programming LanguageWrite a program to assign the value of…
Q: Project -1 A. Using functions and Files: Create a C++ program that let the user perform an…
A: The above Program is Solved in C++ below:
Q: C++ Programming: I need help writing a void function that prints sales details using 3 for loops.…
A: #include <iostream>#include <string>#include <iomanip> using namespace std; int…
Q: Write a c# function that calculates body mass index. This function should accept weight and height…
A: using System;class HelloWorld { static void Main() { Console.WriteLine("B.M.I. Calculator - ");…
Q: PROBLEM: Write a C++ program which accepts a number corresponding to a plane figure: 1. Right…
A: The above program flow will be as follows. The user will be shown options among which they have to…
Q: Python problem Problem statement Write a program that prints all the prime factors of a number,…
A: import math def primeFactors(n): # Print the number of two's that divide n while n %…
Q: write a C program (not C++) + Students are not allowed to use input/output statements for questions…
A: As you have asked multiple questions answering first question. If you want solution of any specific…
Q: Python XYZ store plans to give a festival discount to its customers. The store management has…
A: Given: Python XYZ store plans to give a festival discount to its customers. The store management has…
Q: Write C program (NOT C++) which takes as input a positive integer n and decides whether or not n is…
A: So according to the question, we need to write a code which will return whether a number entered by…
Q: A C++ program calculates the overall loan repayment amount to the bank, with a loan value of…
A: Algorithm : repay function : Step 1 : calculate the repayment according to the formula and store in…
Q: C PROGRAM- USING DATA ABSTRACTION Create: the library(header file), source file(definition),…
A: Program Approach:- 1. Create the header file a)First create the header file name b)Create the body…
Q: The factorial n! of a positive number (integer) is defined by n! = n · (n – 1) · (n – 2 ) ...- 3·…
A: Firstly, create a file with name - B000000_P6_fact.m and, paste the below given Program code: %…
Q: H. Using Structures and Files: Create a C++ program for Banking record system. Note that: program…
A: C++ is a powerful general-purpose programming language. It can be used to develop operating systems,…
Q: C Programming Write a function that takes three integers namely a, b, and c as parameters. The…
A: Given: C Programming Write a function that takes three integers namely a, b, and c as parameters.…
Q: Module/Week 3 ASSIGNMENT (CONTROL STRUCTURES . IF ..ELSE)Write a C++ program that computes a…
A: Instructions for the given program:For the given program, there should exist a file with the name…
Q: Define a function named display_word (encrypted_list) which takes a list of characters as a…
A: The above question is solved in step 2:-
Q: Exercise 1- Square natural numbers Exercise Objectives V Using built in functions Problem…
A: Since no programming language is mentioned, I am using c++ Algorithm: Start Read number n…
Q: Q3: Use C++ void that accept an integer number (N) and a string (name). the void should print the…
A: Code: #include <iostream>#include <cmath>using namespace std; //3void printString(int…
Q: A BOOKSTORE SELLS BOOKS UNDER THE FOLLOWING CONDITIONS: a. IF THE CLIENT IS TYPE 1, 30% IS…
A: Objective: This program reads user data about some book purchases and displays the information after…
Q: Write a C program in which create two functions to calculate the area and circumference of the…
A: #include <stdio.h>#define PI 3.14void Area(int *r);void Circumference(int *r);int main(){…
Q: 3. The factorial n! of a positive number (integer) is defined by n! = n· (n- 1)· (n– 2) . ... 3-…
A:
Q: All task are of c++ language and done using functions. task1: Write program to print the…
A: Create a structure and initialize the values for the width and length of the roof, walls, and the…
Q: Code in c++ please make a program that has two file one main.cpp and other .h header file 1. by…
A: void readdata(){ ifstream fin; fin.open("student.dat",ios::in|ios::binary); student st;…
C
What are the values of x and y inside the main function at /*values here */ in the following code assume all proper header files included
void hello (int *x);
int main(void)
{
int x,y;
x=35;
y=14;
hello(&x);
hello(&y); /* values here */
}
void hello (int *x)
{
int y;
y=*x + 2;
*x = 2 * *x;
}
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- Task - Encode a string (C Language) Modify Project #2, Task #1 (given below) so that input characters are command line arguments. Requirements Name your program project5_encode.c. Input characters are command line arguments. There can be any number of command line arguments. Assume the total number of input characters is no more than 1000. Character handling library functions in ctype.h are allowed. The program should include the following function: void encode(char *input, char *output); The function expects input to point to a string containing the string to be encoded, output to point to a string containing the result. The program should also check if the number of arguments on the command line is greater than or equal to 2. If the number of arguments is 1, the program should display the message "Invalid input!". Examples (your program must follow this format precisely) Example #1 $ ./a.out 7 + 8Output: 3_4 Example #2 $ ./a.out usf.eduOutput: ayl_kja Example #3 $…Solve the problem in C++ (Financial application: compute the future investment value) Write a function that computes future investment value at a given interest rate for a specified number of years. The future investment is determined using the formula in Programming Exercise 2.23. Use the following function header: double futureInvestmentValue( double investmentAmount, double monthlyInterestRate, int years) For example, futureInvestmentValue(10000, 0.05/12, 5) returns 12833.59. Write a test program that prompts the user to enter the investment amount (e.g., 1000) and the interest rate (e.g., 9%) and prints a table that displays future value for the years from 1 to 30, as shown below: The amount invested: 1000 Annual interest rate: 9 Years Future Value 1 1093.80 2 1196.41 ... 29 13467.25 30 14730.575.8 LAB: User-Defined Functions: Max magnitude CORAL LANGUAGE ONLY PLEASE Define a function named MaxMagnitude with two integer parameters that returns the largest magnitude value. Write a program that reads two integers from a user, calls function MaxMagnitude() with the inputs as arguments, and outputs the largest magnitude value. Ex: If the inputs are: 5 7 the function returns and the program output is: 7 Ex: If the inputs are: -8 -2 the function returns and the program output is: -8 Note: The function does not just return the largest value, which for -8 -2 would be -2. Though not necessary, you may use the absolute value built-in math function: AbsoluteValue
- A program uses a function named convert() in addition to its main function. The function main() declares the variable x within its body and the function convert declares two variables y and z within its body, z is made static. A fourth variable m is declared ahead(ie at top) of both the functions. State the visibility and lifetime of each of these variables. Write the code in C++ language. Thanks in advanceWritten in C Please Create a calculator program as follows.Create a menu function named kitten ( function should display the menu options and return the userselection with the following options. Prototype int kitten(void); ) :1 to calculate the number of real solutions for a quadratic equationPrototype: void fluffy(float a, float b, float c);2 to calculate the resistance in series for two or more resistors (no limit on number of resistors)Prototype: float series(float a, float b);3 to calculate the resistance in parallel for two or more resistors (no limit on number of resistors)Prototype: float parallel(float a, float b);4 to calculate the total of raising a value to an integer power value.Prototype float frisky(float x, int y);5 to exit programRepeatedly display the menu after each calculation until option 5 is entered.YOU HAVE TO CREATE AND USE ALL FIVE FUNCTIONS.Option 1:Ask the user for and store the three numerical coefficients of a quadratic equation and store them inthree…This is an computer programming question The code should be in C++ Create a namespace student having following members:a)student_id, student_name, course_code, course_title,obtained_marks, grade, gpab) Create a function void calculate_grade() to calculate the gradeaccording to the criteria given below:c) Create a function void display_grade() to display the graded) Create a function void calculate_gpa() to calculate the GPAe) Create a function void display_gpa() to display the GPAIn the main() function, take appropriate inputs and display the completeinformation of the student.
- done in c++ Program Specifications: Write a program that asks for a user's name and age, finds the ticket price based on the age, and prints out the user's name, age, and ticket price. The program must define the following 3 functions and call them in the main function. Create a function called getName that takes in no arguments and returns the name of the user. Create a function called getAge that takes in the argument age and uses pass-by-reference to set the age of the user. Ensure that the user cannot put in an age that is negative or greater than 100. Create a function called printTicket that takes in the user's name and age and does the following ○ If they are less than or equal to 13 years old set ticket_Price to 9.99. ○ If their age is greater than 13 and less than 65, set ticket_Price to 19.99. ○ If their age is greater than or equal to 65, set ticket_Price to 12.99. ○ Output to the console the user's name, age and ticket price.Write these codes in c language please. Thank you in advance 1. Define a function PrintFeetInchShort(), with int parameters numFeet and numInches, that prints using ' and " shorthand. End with a newline. Remember that "\n" in a string literal starts a new line. Ex: PrintFeetInchShort(5, 8) prints:5' 8" 2. Write a function so that the main() code below can be replaced by the simpler code that calls function MphAndMinutesToMiles(). Original main(): int main(void) { double milesPerHour; double minutesTraveled; double hoursTraveled; double milesTraveled; scanf("%lf", &milesPerHour); scanf("%lf", &minutesTraveled); hoursTraveled = minutesTraveled / 60.0; milesTraveled = hoursTraveled * milesPerHour; printf("Miles: %lf\n", milesTraveled); return 0; } 3. Define stubs for the functions called by the below main(). Each stub should print "FIXME: Finish FunctionName()" followed by a newline, and should return -1. Example output:FIXME: Finish GetUserNum() FIXME: Finish GetUserNum()…01. Question Code in Develop a Java program using NetBeans for Codex. Your program should initially display a menu to the user. The menu should have three options, namely (1) Register for a Training Programme (2) Check Registration details (3) Exit Program (see Figure 3 attached). The program should make use of two functions, registerApplicant() for registering a new applicant andsearchDetails() for searching the registrant details. The registerApplicant() function should accept four lines of arguments namely: the registrant’s name, the registrant’s surname, the registrant’s ID number and training programme. It should then write these details to a text file.To write to the text file or retrieve the product details from the text file, you must have a text file to which you write and store the registrant details. Your text file should be named registrants.txt Also, ensure that the program repeatedly shows the menu until the point when option 3 is selected which terminates the program. .
- In C++, please write a program according to the instructions and all the criteria. Thank you. Instruction Write and test a function that returns a copy of its string parameter with no repeated characters. The functions ignore case when they compare letters. The functions return strings whose letters are upper case. Write 2 versions of the function: string remDups(const string& original); void remDups(const string& original, string& nodups); Suppose the original string is “Myrtle has big feet” The function returns MYRTLE HASBIGF Test the functions thoroughly. Criteria compile, run, test the test program compiles, runs, and calls both versions of the function without crashingthe test program tests the functions thoroughly function parameters and returns one function has one constant string reference parameter and returns a stringone function has one constant string reference parameter, one string reference parameter and returns void. function operations the function removes…C++ PROBLEM: PASTE INDENTED CODE PLZZ Given the following functions:void increment(int x, int y) {x+=y;} int main() {int n=10, amount = 5;increment(n,amount);cout << n << "\n";return 0;} 1. Explain the problem with the increment function.2. Explain how to fix the problem without changing the main function.Write a c++ program to display a calendar for a given year. Type of Branches such as switch statements, if-else, and etc. should be used as well. You can't define functions or use Void. Everything should be written inside int main(). Code should be written in this type of format: #include <iostream>using namespace std; int main() { /* Type your code here. */ return 0;} Ask a user to enter the year and the new year's day of the year entered: cout <<"Enter a calendar year to display?"; cout <<" what is the new year's day?"; a leap year is: IF year%4 = 0 AND year%100 != 0 OR year%400 = 0 An example of what the program should display as a result is in the two images attached.