if/else statements

if/else statements

I'm having a hard time programming this question: code an if/else statement that test the value of a string variable named shippingMethod to determine if it has a value of "UPS," "FEDEX," or another value. If the value is "UPS," code another if/else statement that tests the value of a double variable named weight. If the value of weight is less than or equal to 5, set a double variable named shipppingBase to 4.95. If weight is greater than 5 and less than or equal to 10, set the shippingBase variable to 7.95. And if weight is greater than 10, set shippingBase to 10.95. If the value of shippingMethod is "FEDEX," set shippingBasse to 7.95. And if shippingMethhod is another value, set shippingBase to 9.95.

Would you help me?

View Answers









Related Tutorials/Questions & Answers:
if/else statements
if/else statements  I'm having a hard time programming this question: code an if/else statement that test the value of a string variable named.... If the value is "UPS," code another if/else statement that tests the value
Objective C if else statements syntax
Objective C if else statements syntax  What is the syntax of if else statements in Objective C?   Using of if else statement in Objective C There is no changes in the syntax format of if else statement. You can write
Advertisements
Java if else
Java if else       The if-else statement is one of the widely used control flow statements while..._TO_REPLACE_1 if (booleanexpression) { /*Statements*/ } else{ /*Statements
Java Control Statements
: the decision making statements (if-then, if-then-else and switch), looping... if and if-else statements. To avoid this we can use Switch statements... Java Control Statements      
Java Control Statements
statements (if-then, if-then-else and switch), looping statements (while, do-while... } Switch Statement: This is an easier implementation to the if-else statements... Java Control Statements     
The else Keyword
The else Keyword        The else is the one more keyword of Java. It is used to specify a statement or block of statements that are executed when the condition for testing specified
Operators; If, Else, Elseif; Loops
 3.9. Operators; If, Else, Elseif; Loops Conditional Statements If, Else, Elseif are called the Conditional statements that are used for performing... have the following conditional statements: 3.9.1. if statement if statement
Mysql Else Condition
Mysql Else Condition       Mysql Else Condition evaluate the statements in database to perform..._TO_REPLACE_1 The Tutorial illustrate an example from the 'Mysql Else Condition
JavaScript Conditional Statements
. JavaScript supports if , else, switch case and conditional operator for this purpose. JavaScript Conditioanl Statements Example 1(if):ADS_TO_REPLACE_1 <... Example 2(if-else):ADS_TO_REPLACE_2 <html> <head> <
predicates and statements?
predicates and statements?  Explain about predicates and statements
If and else if ladder
If and else if ladder  How we can use if and else if statement?  ...) System.out.println("Grater than 100"); else if(i < 50) System.out.println("Grater than 50"); else
programes on if....else
or not write a program to find minimum of 3 nos using nested if else. write... a program to input score of a student out of 100 and print grades using else...){ System.out.println("Leap Year!"); } else{ System.out.println("Not a Leap
If-else not working
If-else not working  <%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %> <html> <...="SELECT REGNO,SNAME FROM sub_comb WHERE L_category='Lab'"; } else if (Lab
If-else not working
If-else not working  <%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %> <html> <...="SELECT REGNO,SNAME FROM sub_comb WHERE L_category='Lab'"; } else if (Lab
Use if else and end statements in velocity
Use if else and end statements in velocity       This Example shows you how to Use...;=="komal") Hi Komal... #else Hi .... #end Output
if else statement in java
if else statement in java  if else statement in java explain with example
if else condition - Java Beginners
if else condition  Please explain the if else condition in Java programming language
if else statement in java
if else statement in java  explain about simple if else statement and complex if else statement in java with an example
java program using control statements...
java program using control statements...  public class...){ System.out.println("It is zero"); else if(x>0) System.out.println("it is positive number"); else if(x<0) System.out.println
if else in javascript function
if else in javascript function  How can i write the else statement in JavaScript to check if the web browser is IE or not? Is there any other way to validate this way ..? Thanks
ELSE STATEMENT!! - Java Beginners
ELSE STATEMENT!!  Hi! I just want to know why doesn't my else statement works? Else statement is there in the code below which is: else JOptionPane.showMessageDialog(null, n+ " is not in the array!");//doesn't work
switch case instead of if else
switch case instead of if else  How to write code in switch case instead of if else in Java
Java if else condition
Java if else condition  its there any similar condition for (X<=5 || y<=10) please post the answer as soon as possible.... TQ
DECESION MAKING STATEMENTS
DECESION MAKING STATEMENTS  The Decision Making statements may be implemented in different forms depending on the complexity of the condition to be tested. Describe various forms of decision making statements in java
check condition in if-else block
check condition in if-else block  Hi, I want to update database with following query int i= st.executeUpdate("Insert into text_editor(words) values('"+words+"')"); how can I give a check option so only valid words are inserted
The INSERT INTO Statements in SQL?
The INSERT INTO Statements in SQL?  The INSERT INTO Statements in SQL?   Hi, The INSERT INTO statement is used to insert a new row or multiple rows into a table.ADS_TO_REPLACE_1 SQL INSERT INTO Syntax INSERT
using if and else if statments
using if and else if statments  Hello everyone Hope all are well Just new here & already have a question. I have a little veg shop it sells 6... if and nested if and else if This has my head in bits for days I have the below done x6
If and else statement - JDBC
If and else statement  Dear Sir, I had created a statement...); ======================================================= how to create a if and else statement... or else it will prompt a message dialog to indicate that the word is already
IF-ELSE In JSTL
IF-ELSE In JSTL In this section we will read about implementation of if-else.... In JSTL if-else tag is not implemented directly like the if-else statement is used on the Java/JSP coding. Implementation of if-else tag in JSTL coding
IF-Else Conditional Statement
IF-Else Conditional Statement Conditional Statements are used to carry out actions based on condition. If-Else is also a conditional statement used... the following conditional statement : if statement if...else statement
general syntax for a SELECT statements
general syntax for a SELECT statements  Write down the general syntax for a SELECT statements covering all the options   Hi, The general..._TO_REPLACE_1 this syntax shows how we can use different optin with the select statements
Control Tags-If / Else If / Else
Control Tags-If / Else If / Else      ... are used for flow control such as if, else and iterate.)  'If' tag could be used by itself or with 'Else If' Tag and/or single/multiple 'Else' Tag. Create
What is the Delete Statements in SQL?
What is the Delete Statements in SQL?  What is the Delete Statements in SQL?   Hi, Here is the answer,ADS_TO_REPLACE_1 Delete statement in SQL is used to delete partial/all data. Especially delete statement is useful
Avoiding â??!= nullâ?? statements in Java?
Avoiding â??!= nullâ?? statements in Java?  Avoiding â??!= nullâ?? statements in Java
ModuleNotFoundError: No module named 'maybe-else'
ModuleNotFoundError: No module named 'maybe-else'  Hi, My Python... 'maybe-else' How to remove the ModuleNotFoundError: No module named 'maybe-else' error? Thanks   Hi, In your python environment you
Decision-making Statements in java 7
_TO_REPLACE_2 if(condition) {............. statements... } else... nested if-else statements. Switch Statement : ADS_TO_REPLACE_3 Switch.... Like if-else statements, switch statement holds many conditions to execute
ModuleNotFoundError: No module named 'flake8-if-statements'
ModuleNotFoundError: No module named 'flake8-if-statements'  Hi...: No module named 'flake8-if-statements' How to remove the ModuleNotFoundError: No module named 'flake8-if-statements' error? Thanks   Hi
ModuleNotFoundError: No module named 'flake8-if-statements'
ModuleNotFoundError: No module named 'flake8-if-statements'  Hi...: No module named 'flake8-if-statements' How to remove the ModuleNotFoundError: No module named 'flake8-if-statements' error? Thanks   Hi
else if (selection = * 'M'); - Java Beginners
else if (selection = * 'M');  I am trying to get 2 numbers 2 multiply and i keep getting this error illegal start of expression else... + number2)); else if (selection = - 'S') System.out.println(number1
PHP Else Construct
Else Construct: Else construct is generally used when a previous condition does not met, it means that we place the else construct after if statement and if  'if statement' does not met, then the else part
jstl if else
In this section we have discussed about how to implement if-else tag in JSTL..., as their is not default value. Hence, if-else tag is not implemented directly but is implemented... like if-else statement in a java programming. It performs conditional operations
Hibernate generated SQL statements on console
Hibernate generated SQL statements on console  If you want to see the Hibernate generated SQL statements on console, what should we do?   If you want to see the Hibernate generated SQL statements on console just add
Statements in JDBC - Java Interview Questions
Statements in JDBC  Hi, Explain statement, preparedstatement, callable statement. which is best and why. when to use preparedstatement. plz dont give link . explain ur words with example
Executing Set of SQL statements in Java
Executing Set of SQL statements in Java  Hi, I am trying to execute a procedure which is stored in MS SQL server's database. I have configured...= cstmt.executeQuery(); The procedure has drop temp table statements, select multiple
Controlling your program
(if-then, if-then-else, switch), the looping statements (for, while, do-while), and the branching... programs using if and if-else statements. To avoid this we can use Switch...; We all know that the execution of the statements in a program takes
ModuleNotFoundError: No module named 'financial-statements-downloader'
ModuleNotFoundError: No module named 'financial-statements-downloader' ...: ModuleNotFoundError: No module named 'financial-statements-downloader' How to remove the ModuleNotFoundError: No module named 'financial-statements-downloader' error
Switch
; Sometimes it becomes cumbersome to write lengthy programs using if and if-else statements. To avoid this we can use Switch statements in Java. The switch statement... statements and an optional default statement.  The execution of the switch
Control Flow Statements in java 7
Control Flow Statements in java 7 In this section we will discuss Control Flow Statements in java 7. This is one type of Language Fundamentals. Control Flow Statements : - In general program execution flow is from top to bottom
MySQL Transactional and Locking Statements
and for kill the all threads and statements then you need the SUPER privilege else you... MySQL Transactional and Locking Statements  ... by statements like START TRANSACTION, SET AUTOCOMMIT, COMMIT and ROLLBACK. Transaction
Java Control Statement
statement :  Java supports two selection statements, if and switch...: if(conditional expression) statement;   2. The if-else statement... false then the statement in the else get executed. You can put a single code

Ads