C1. Write an assignment that assigns to a variable named red_change the percentage change in the red level if red were updated to be 128. (Hint: use floating point division) C2. Write an assignment that assigns a variable named new_blue so that it contains the blue value (as a float), assuming the new_blue value is equivalent to blue increased by 25 percent.
Q: If the variable letter has been defined as a char variable, which of the following are not valid…
A: If the variable letter has been defined as a char variable, which of the following are not valid…
Q: What default value is assigned to each of the following variables?a. Integerb. Doublec. Booleand.…
A: Answer: In java, a. The Default value of Integer is 0 b. The Default value for Double is 0.0 c. The…
Q: Write the following 3 assignments: • Write an assignment statement that assigns the int literal…
A: Required: Write an assignment statement that assigns the int literal 16741656 to a variable named…
Q: A variable should hold the name for a player on a sports team. Which data type should the variable…
A: Please find the answer and sample Java program in the below steps.
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: Which scanf() statement will you use to scan a float value (a) and double value (b)? Float a;…
A: Answer is given below .
Q: Rewrite the following variable definition so the variable is a named constant with the value 12. int…
A: "const" keyword is used to represent the constant variable The constant value which can give the…
Q: Indicate whether each of the following is a legal variable name. If it is not,explain why. totalCost
A: Identifying the given variable name is legal or illegal: The given variable name is totalCost. If…
Q: What is a constant that contains a single character enclosed within single quotes? * Character…
A: a) A character constant is consists of a single character within the single quotes. This also…
Q: For each of the following variable definitions, determine whether the statementis valid or invalid.…
A: Given: For each of the following variable definitions, determine whether the statementis valid or…
Q: 8. Which one of the following statements returns the same result no matter how many times it is…
A: I have given an answer in step 2.
Q: In cell B13, create a formula without a function using absolute references that subtracts the values…
A: In cell B13, create a formula without a function using absolute references that subtracts the values…
Q: Q2: Fill in the blank. 1. Default value of any reference variable is
A: Given: Any variable's default value is.
Q: 3. Examine the given flowchart and answer the following question. start input employee #, hours, pay…
A: - We have to work on the flowchart to make it work for the instructions. - We have to add the loop…
Q: Given the following code, how would you change it to implement default arguments such that the…
A: #include <iostream>using namespace std;float calculate(float=0.05,float=1000);int main(){…
Q: Describe what and how many values below variable is storing the values? int list[100];.
A: Programs are used to perform specific tasks, the task may be simple such as calculating the addition…
Q: Which of the following is a valid declaration for phone number? А. int phoneNumber; В. char…
A: Given:
Q: 18.) What are the results of the following relational expressions, true or false? int x = 4; int y =…
A: As per guideline we are supposed to answer only one question. Kindly repost other questions as a…
Q: 3.3 Write the result of the following C++ statements float x 3.444 , y 8.0 a.…
A: Initially precision is fixed as 2 and x is printed and thus 3.44 gets printed Then, precision…
Q: What is the value of balance after the following code is executed? int balance = 10; while…
A: Step 1:- Program:- #include <iostream>using namespace std;int main(){ int balance = 10;…
Q: Given the following code segment, what will be the value of the variable "Val" after executing the…
A: The indexOf() method returns the position of the first occurrence of specified character(s) in a…
Q: ello, Can someone please help me with this code. Its adding another line to each year.
A: The given problem is related to Python programming where the program is already provided to take…
Q: 4. A variable should hold all the letters of the alphabet. Which data type should the variable be?…
A: GIVEN: 4. A variable should hold all the letters of the alphabet. Which data type should the…
Q: Which of the following is false? a. When you pass a variable by reference, the receiving procedure…
A: The false option is OPTION (B)
Q: Specify the local and Global variables used in the code below and express the reason
A: Before giving answer to above question we need to know that: Those variables which are defined…
Q: Declaration of variables shares - 2000 shareBuy - 40 shareSell - 42.75 brokerRate - 0.03 SProcessing…
A: Introduction of Flow Chart: A flow chart is a pictorial representation of any task or program. It…
Q: X is integer value based on your the last TWO(2) digit Matric Card number. If the value X is ODD,…
A: #include<stdio.h>int main(){ int x; printf("Enter the value of x: "); scanf("%d",&x);…
Q: which of the following would be stored in an "integer" variable? a. false b.50 c."fifty" d.5.0
A: Here have to determine correct option for value that can store in Integer variable.
Q: n cell C7 type a PMT function to calculate the monthly payment for the Lon amount in B7 and the rate…
A: Given the excel sheet, we need to identify formulas required to provide expected results. answer is…
Q: Given the table below, declare the following variables with the corresponding data types and…
A: PROGRAM CODE: #include <stdio.h> // include header file for standard input output…
Q: Expressions For each expression in the left-hand column, indicate its value in the right-hand…
A: 1. Given expression: 1 + 2 * 3 - 4 * 5 * has highest precedence followed by +,- So, the given…
Q: Given the following code segment, what will be the value of the variable "result" after executing…
A: Given: Given the following code segment, what will be the value of the variable "result" after…
Q: Please declare a variable of the data type int named "myVariable". ( don't add an empty space before…
A: To declare a variable of the data type int named "myVariable"
Q: Suppose the Double variable num has the value 123.4567. What value will the following statement…
A: num will get the value as 123.4600
Q: Write an assignment statement that increments the decTotal variable by the value in the decRegion…
A: Assignment operator is ' = ' this. When you will use this operator while write statement then that…
Q: Write a series of if statements that will evaluate your grade contained within a variable called…
A: Since Programming language is not mentioned i have used python for solution Code
Q: 7. How would you declare a variable storing a person's name? String name = Jeff; String name =…
A: Answers of the problem is given below. in step 2 A declaration of flexibility in a computer…
Q: 1-) Ask user's name and keep it in name variable. 2-) Get a midterm grade from.user(0-100). 3-) Get…
A: The Program in C++ :
Q: Which of the following statements places input into the variable "value"? a) value >> cin; b) cin >>…
A: The cin object in C++ is an object of class istream. It is used to accept the input from the…
Q: Which of the following statements is false? The following assignment statement adds the values…
A: Actually, the answer has given below;
Q: Which of the following data type is not used by switch statement? a. break b. char C. int d. float
A: types are supported by the switch statement: char, short, int, long, long long, enum, or anything…
Q: Write the statement to declare the intMAXIMUM named constant whose value is 100.
A: To Find: Statement to declare the intMAXIMUM named constant whose value is 100.
Q: To remove the value of a variable but keeping the variable in PowerShell, we can use this cmdlet:…
A: To remove the value of a variable but keeping the variable in PowerShell, we can use this cmdlet:…
Q: What will be displayed by the following segment of code? int option = 7; switch(option) {case 1:…
A: b) IUPUI Explantion: As option holds the value 7, and switch statement tries to find case value…
Q: 13. Which data type should be used to hold the number of people who have entered a store? A.Integer…
A: GIVEN: 13. Which data type should be used to hold the number of people who have entered a store?…
Q: Which of the following is invalid variable name? a. -HCT b. SCT_ c. _HCT d. SCT
A: Which of the following is an invalid variable name? a. -HCT b. SCT_ c. _HCT d. SCT Answer: -HCT…
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- Assume that grade is a variable whose value is a letter student_grade-- any one of the following letters: 'A', 'B', 'C', 'D', 'F". Assume further that there are the following int variables, declared and already initialized: acount, bcount, ccount, dcount, fcount. Write a switch statement that increments the appropriate variable (acount, bcount, ccount, etc.) depending on the value of grade. So if grade is 'A' then acount is incremented; if grade is'B' then bcount is incremented, and so on.1- You are required to draw flow chart and write a Pseudocode for the followingproblem statement.Muscat MobiCare is a Mobile Outlet, which provides Mobile repair services. The charges of mobilerepairs are based on the type of the service.Details of charges are as follow:Software Fault: 4 OMRScreen Fault: 6 OMRNetwork/Wi-Fi Fault: 8 OMRInternal Hardware Fault: 10 OMRThe Outlet offers discount to the loyal customers. The discount is offered based on the customervisits to the outlet.Following is the detail of discounts.1- Customer visiting 4 times a year gets 20% discount.2- Customer visiting 6 times a year gets 30% discount.3- Customer visiting 8 times a year gets 50% discount.You are required to draw a Flow Chart diagram and write a Pseudocode for a computer programthat takes customer name, mobile model, visit date, total number of visits, and required service(mentioned above). The program outputs a receipt with all the entered information plus repaircharges based on the required…You have received the following SMS message for your "Super Boost" vaccine registration: These are your "“Super Boost" vaccine registration information: Name : Wong Choon Yee Vaccine Type : B Age : 65 Fees : 12.00 Show your information to the medical staff on duty when you have arrived at the vaccination center. Write a C program segment to prompt the user to enter the vaccine registration information. You are required to declare the necessary variables by using the appropriate data types and meaningful identifier names in your program. [Note: You should follow the rules in Camel Case Naming Convention when naming the identifiers]
- 1- You are required to draw flow chart and write a Pseudocode for the following problem statement. Muscat MobiCare is a Mobile Outlet, which provides Mobile repair services. The charges of mobile repairs are based on the type of the service. Details of charges are as follow: Software Fault: 4 OMR Screen Fault: 6 OMR Network/Wi-Fi Fault: 8 OMR Internal Hardware Fault: 10 OMR The Outlet offers discount to the loyal customers. The discount is offered based on the customer visits to the outlet. Following is the detail of discounts. 1- Customer visiting 4 times a year gets 20% discount. 2- Customer visiting 6 times a year gets 30% discount. 3- Customer visiting 8 times a year gets 50% discount. You are required to draw a Flow Chart diagram and write a Pseudocode for a computer program that takes customer name, mobile model, visit date, total number of visits, and required service (mentioned above). The program outputs a receipt with all the entered information plus repair charges based on…A game program contains the following code to update three score variables, health, food, and knowledge. The maximum values for the three variables are 100, 80, and 25, respectively. The game program’s author would like to write a procedure that could be used to update any variable in the game (myScore) that has a maximum value (myLimit) by a given amount (myAmount). A correct call of the procedure is shown below. Which of the following is a correct implementation of updateScore ? 4 answer options in picture below, full question in other picProvide description on how to use the code. Code is located below: # initialize a flag variable with 0flag = 0 # loop will execute till flag is 0 in the sense loop will execute codewhile flag == 0 : #until amount is greater then costcost = float(input("Enter the cost: ")) # take input cost and convert to floating data typeamount = float(input("Enter the amount given(should be greater than cost): ")) # take inputif amount < cost :print("Amount should be greater than cost.") #print statement saying enter Amount thatelse:flag = 1 # when amount entered by user greater then cost flag is set to 1 and while loop will not execute change = amount-cost #stored difference between amount and cost to change variableprint(f"The change to be given is ${change}") #print the value of change variable twenty=0 #intializing all possible coin/ notes to 0ten=0five=0single=0quarter=0dime=0nickel=0penny=0 while change>=20 : #loop will execute until change become less then 20. this loop execute for…
- For the following code: for ( a = 1, b = 5, c = 3; a < 4; a++, b++ ) { c = a * b + c; } Indicate what values for the following variable will be when the code endsa=b=c=Please add flowchart. Start the code: def convert_km_to_miles( km ): Function -- convert_km_to_miles Converts kilometers to miles. Absolute Value Parameters: km (float) -- the original distance in kilometers Returns a float value representing the original distance converted to miles return abs(km * 0.621371) def convert_miles_to_km( miles ): Function -- convert_miles_to_km Converts distance from miles to kilometers. Absolute value Parameters: miles (float) -- the original distance in miles Returns a float value representing the original distance converted to kilometers return abs(miles 1.60934) The United States is one of the last countries to still use the imperial system and miles for measuring distance. One software conversion error between US and metric measurements sent a $125 million NASA probe to its fiery death in Mars' atmosphere (Links to an external site.). The starter code given includes two functions that convert between metric and imperial values for distance (kilometers…You are writing an application that uses the sqrt function. The program must reference the function using the name squareRoot.You need to import the function.Which code segment should you use? Group of answer choices D. from math.sqrt as squareRoot A. import math.sqrt as squareRoot B. import sqrt from math as squareRoot C. from math import sqrt as squareRoot
- Define returning a valueuse visual basic Depreciation to a Salvage Value of 0 . For tax purposes an item may be depreciated over a period of several years, n . With the straight-line method of depreciation , each year the item dpreciates by 1/nth of it original value. with the double-declining-balance method of depreciation, each year the item depreciate by 2/nths of its value at the beginning of that year.(In the final year it is depreciated by its value at the beginning of the year. ) Write a program that performs the following tasks:(a) Request a description of the item, the year of purchase, the cost of the item, the number of years to be depreciated (estimated life), and the method of depreciation. The method of depreciation should be chosen by clicking on one of two buttons.(b) Display a year- by-year description of the depreciation. See Fig. 6.15 .You are writing an application that uses the sqrt function. The program must reference the function using the name squareRoot.You need to import the function.Which code segment should you use? Group of answer choices from math.sqrt as squareRoot import sqrt from math as squareRoot from math import sqrt as squareRoot import math.sqrt as squareRoot