Write a program that defines an integer variable named age and a doublevariab le named wei ght. Store your age and weight as literals in the variables.The program should display these values on the screen in a manner similar tothe following:Program OutputMy age is 26 and my weight is 168.5 pounds.(Feel free to lie to the computer about your age and weight. It will never know!)
Q: Fill out the table below by writing an explanation of the given variable statement. This involve…
A: Variable: The name of the memory location is called variable. It is used to store data. variables…
Q: 7) ( )If we define variables: int a=2, b-4, c-6; the value of the following expression ((a> b? a: b)…
A: The required code has ternary operators (denoted by '?' which is short form of if-else) and thus are…
Q: Task 2: Write a program where you declare an integer variable, a double variable and a character…
A: Use the following to convert integer to : (i) decimal use %u or %d (ii) octal use %o (iii)…
Q: (b) Evaluate the following expressions and determine the value of all variables, based on the above…
A: Given, int val, h=90, i=8, j=25, j=7; should find values of, i) val = --h % k++ * 2; ii) val = (93+…
Q: Write a program for calculating the simple interest on a loan when the initial prin- cipal amount…
A: PROGRAM CODE: public class Main{ public static void main(String[] args) {…
Q: A simple rule to estimate your ideal body weight is to allow 110 pounds for the first 5feet of…
A: Program Code: #include <iostream>using namespace std;int main(){int feet, inches, weight; cout…
Q: usiness that uses functions to calculate the weekly payment amounts of employees in a workplace. you…
A: A business that uses functions to calculate the weekly payment amounts of employees in a…
Q: Assume the following variable definitions: int a = 5, b = 12; double x = 3.4, z = 9.1;What are the…
A: Note: There are multiple questions are given in one question. According to the rule, you will get…
Q: Task 2: Write a program where you declare an integer variable, a double variable and a character…
A: To convert integer to (i) decimal use %u or %d (ii) octal use %o (iii) hexadecimal value use %x or…
Q: Write a program that reads from a student his/her name and his/her ID which is formed of 8 digits.…
A: The solution to the given problem is below. **Note: As programing language is not mentioned in the…
Q: Write a program that prints a grocery receipt of items purchased.
A: EXPLANATION- Create main function . Declare seven variables with suitable names Initialize all the…
Q: In a computer program, the _variables are visible in a unit without the need of their declaration in…
A: Explanations: 33: local variables are always need to be declared in the same unit. and they are not…
Q: Suppose that the average age of a Python programmer at Google is 30 and the average age of a Java…
A: Given that, The average age of the Python programmer at Google is 30 The average age of the Java…
Q: Write a program that declares double variable x 5.8. It then computes and prints the value of the…
A: A required C++ program is as follows, File name: “main.cpp” #include<bits/stdc++.h> using…
Q: Write a program that reads in an investment amount, the annual interest rate, and the number of…
A: PROGRAM CODE: import java.util.Scanner; public class Main { public static void main(String[] args) {…
Q: WRITE A PROGRAM TO CALCULATE THE SIMPLE INTEREST ON A LOAN AMONUT OF 50000 GHANA CEDIS AT AN…
A: PROGRAM: //Header file #include<iostream> //Using namespace using namespace std;…
Q: "Write a program that computes the amount of calories burned when you run. Your program should ask…
A: Algorithm: 1. Take input as duration,speed,weight. 2. Initialize MET to 0. 3. Make MET=8 if speed is…
Q: Following is an example of different ways one can declare variables for some programming language.…
A: following are the possible Regular expressions :
Q: Imagine you are writing a program that stores a student's year (Freshman, Sophomore, Junior, or…
A: We have to write the program for displaying the year of the student, number of courses taken and the…
Q: Write a complete well-documented program that: • Prompts the user to enter from the keyboard 2…
A: According to the question below the complete Program: Program Output:
Q: A variable in a program is a named placeholder that can contain any integer value. The statement z +…
A: Below is the complete solution with explanation of the given question. The value of each iteration…
Q: Write a program which given an initial three digit number such as. three_digit_number = 123 prints…
A: Program In c # include <stdio.h># include <conio.h>#include<math.h>int main( ){int…
Q: Create a program, change.py, that has a function that takes 5 arguments that correspond to the…
A: Answer: Algorithms Step1 : we have assume penny cost is 1 cent and nickel cost 5 cent, dime cost is…
Q: WRITE A PROGRAM TO CALCULATE THE SIMPLE INTEREST ON A LOAN AMONUT OF 50000 DOLLARS AT AN INTEREST…
A: Approach: Import necessary packages from java.util.scanner class. Create a class called…
Q: I need to write a program named Palindrome.java that prompts the user to enter a string. The program…
A: Here I have created the function named isPalindrome(). In this function, I have created an object of…
Q: Following is an example of different ways one can declare variables in some programming language.…
A: Following are the possible Regular expressions : [] Used to find any of the characters or numbers…
Q: Write a program that prints a grocery receipt of items purchased. The program must create variables…
A: NOTE : Since the programming language is not defined. So the programming language used here is…
Q: Write a program named Eggs that declares four variables of type int to hold the number of eggs…
A: It is a simple program, we know that a dozen is equal to 12 in quantity that means if someone says 1…
Q: Suppose x, y, and z are int variables and w and t are double variables. What value is assigned to…
A: Answer:
Q: (b) Evaluate the following expressions and determine the value of all variables, based on the above…
A: #SOLUTION: ( i ) expression -> --h % k++ * 2 initially h=90 and k=7 . Now solving the…
Q: Question 1 a) Write a program that reads in the radius and length of a cylinder and computes volume…
A: Question 1) a) SOLUTION:- CODE:- import java.util.Scanner; public class Main { public static void…
Q: By using NetBeans software to: Write a java program to convert weather temperature from Fahrenheit…
A: Below is the code in java and sample output:
Q: Write a program that asks the user to enter an amount of money in the format of dollars and…
A: Program converts the amount taken from user in dollars and cent and returns the amount of coins user…
Q: How do i solve this problem in python? ( has 3 steps)
A: NOTE:The given information is incomplete (Formula to calculate the minutes to walk or run for a…
Q: 20. Give meaningful identifiers for the following variables and write a proper C11 declaration and…
A: The Answer is in step2
Q: 1. Write a program that will read an employee name (use your Name as input in employee name),…
A: Solution - Programming Language - C All necessary comments are included in program code. Program…
Q: Write a program that has 2 variables: weeks and days declared as integer type. Enter number of…
A: Logic:- declare two variables week and days. Input number of week from user. Days=week*7 display…
Q: Write a program that defines an integer variable named age and a double variable named weight. Store…
A: //Program to display the age and weight #include <iostream> using namespace std; int…
Q: Write a program that reads from a student his/her name and his/her ID whic program should display…
A: import java.util.Scanner;public class Main{ public static String getDay(int code){ // divide code…
Q: Write a program that calculates a weekly wage, based on an hourly payrate and how many hours were…
A: Answer:
Q: Suppose that the average age of a Python programmer at Google is 30 and the average age of a Java…
A: Given that, The average age of the Python programmer at Google is 30 The average age of the Java…
Q: Write a program to input your password. Password must be invisible or may not be seen by the user…
A: Since language is not mentioned I am providing the answer in C. If you want to answer in another…
Q: Given a variable named yescount (containing an integer) and another variable named nocount…
A: In the solution to the given problem, we need to use an if-elif-else statement to test the value of…
Q: Suppose a, b, and sum are int variables and c is a double variable. What value is assigned to each…
A: static_cast<> is a compile time casting. It is used for implicit conversions between types.…
Q: Write a program that reads the following information and prints payroll statements. These are the…
A: <?php //getting full name from user $fullname = readline('Enter fullname : ');…
Q: Write down the regular expression that can generate such variable declarations. Assume all variable…
A: Please see the next step for solution.
Q: Write a program to determine the equivalent grade of each student in class as follows: a. Read in…
A: Sample output
Write a
variab le named wei ght. Store your age and weight as literals in the variables.
The program should display these values on the screen in a manner similar to
the following:
Program Output
My age is 26 and my weight is 168.5 pounds.
(Feel free to lie to the computer about your age and weight. It will never know!)
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
- 1. Write Python code that prompts the user to enter his or her income and assigns the user's input to an integer variable named income. 2. Write Python code that prompts the user to enter his or her favorite hoppy and assigns the user's input to a variable named hoppy.Write a program that declares a variable that represents minutes worked on job and assign a value. Display the value in hours and minutesWrite a program to calculate the position of a projectile at a given time t. For an initial velocity vo and angle of departure ®g, the position is given by x and y coordinates as follows (note: the gravity constant g is 9.81 m/s²): X= V0 Cos (0)t y=vo sin (8,)t –; gt The program should initialize the variables for the initial velocity, time, and angle of departure. It should then call a function to find the x and y coordinates, and then another function to print the results
- Following is an example of different ways one can declare variables in some programming language.Write down the regular expression that can generate such variable declarations.Assume that- All variable names are at most five (previously written as exactly five; both will be considered correct) characters long. Variable names can contain only small letters [a-z], digits [0-9], and two special characters $ (dollar) and _ (underscore). $ sign can only be used at the beginning. No names can start with digits. The variable types are integer, real, char, and Boolean only. The word ‘var’ which denotes variable is optional. Ignore any whitespace (space, tab, newline, etc.) Infer the rest of the rules from the code snippets below-var int1 : integer;var foo_1 : boolean;var f2 : real;_ind: char;x, y, z: integer;Write a wholly creative quiz program that consists of three original questions that you make up according to these specifications: One question should require user input of type int One question should require user input of type float One should require a string input The quiz should be scored by using a counter variable that has an initial value of zero and is incremented by one for every correct answer. Provide feedback to the user for each question, and report the total score when the quiz has finished. Example runs not shown. It's a creative exercise. def main():points = 0states = int(input('How many states in the USA? '))if states == 50:points +=1print('Correct. Good job!')else:print('Sorry, the answer is 50') points = 0capital = input('What is the capital of England? ')if capital == "London":points+=1print('Correct. Well done.')else:print('Sorry, the answer is London .') points = 0points = float(input('How many points does a pentagram have? '))if points == 10:points…Variables of type single occupy half the memory of variables of type double, but they have lower precision and a more limited range. O True O False
- Create a program that uses 3 variables named: “name”, “address”, and “phone”. Assign these three variables to input statements ,input("blah blah blah"), asking the user to enter their name, address and phone number. Such as: x = input(“Please enter a number between 1 and 100”) Then use 3 prints statements to print the values stored in the 3 variables. Don’t hard-code values in the print statements. Such as: print("Your name is: ", name) Add an extra, empty, print statement before your 3 print statements to create a blank line in your output so your program is more readable. A blank print statement looks like: print( ) Using a variable in your print statement makes your statement more robust. If the value changes say to 42 then you don’t have to change your print statement it will display the, correct, new number. Name the source code file yourName_lab3_1.py. Run the program. Capture the output and save it as an image file named yourName_LAB3_output1. pg.Only the same type of constant can be put in the same type of variable. Is it true or false?8. Total Purchase A customer in a store is purchasing five items. The prices of the five items are as follows: Price of item 1= $15.95 Price of item 2= $24.95 Price of item 3= $6.95 Price of item 4= $12.95 Price of item 5= $3.95 Write a program that holds the prices of the five items in five variables. Display each item's price, the subtotal of the sale, the amount of sales tax, and the total. Assume the sales tax is 7 percent.
- Body Mass Index (BMI) is a measure of health on weight. It can be calculated by taking your weight in kilograms and dividing by the square of your height in meters. Write a program which prompts the user to enter the weight in kgs (integer value) and height in feet and inches (both integers) and then calculates the BMI of the person. Your program first need to convert inches to meters (i.e. inches * 0.0254) and then use the following formula to calculate BMI: weight kilogram / (height_meter)^2 Your program displays the BMI value in two decimal places and the corresponding status as shown in the examples below. Note that one inch is 0.0254 meters and 1 foot is 12 inches. For example: Input Result 62 5 10 89 6 0 45 BMI BMI < 18.5 18.5 s BMI < 25.0 25.0 ≤ BMI < 30.0 30.0 ≤ BMI 7 82 5 Interpretation Underweight Normal Overweight Obese 2 Enter weight (kg): Enter height (feet): Enter height (inches): BMI is 19.61, Normal Enter weight (kg): Enter height (feet): Enter height (inches): BMI is…Write a flowchart and C code for a program that does the following: Declare variables with integer or float datatypes. Assign the values of three grades (84, 98, 73) to each of the variables Compute the average of the grades – keep the order of operations in mind Display the average using an appropriate message Add a decision that checks to see if the Average grade is greater than 65, if true display a message that the student passed. Be sure to add comments throughout your program describing what is happening Review the output below to check your work. Paste the following three items into a Word document (.docx) Your flowchart in Flowgorithm A screenshot of your codeWrite a C program which prompts the user for the name of the brand of a phone they would like to purchase. Your program should store the user-entered name in a variable named brand. You should instruct the user to enter a single letter to match each brand ('S' for 'Samsung', 'A' for 'Apple', etc.) and output the amount to be charged based off this table: Brand Samsung Apple Motorola Google LG HTC or Nokia Price $500 $450 $400 $375 $350 $200 For instance, if the user enters "Samsung" as their choice, your program should then display to the user: "You have chosen to purchase a Samsung phone, you will be charged $500". Your program should make sure to validate the input data; if the user enters anything other than the brand names, you should display a message telling them that invalid data has been entered.
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)