Answer:
Written in C++
#include<iostream>
using namespace std;
int main()
{
const float SALES_TAX = 0.06625;
int total = 1000;
cout<<"Total: ";
cin>>total;
float grand_total = 0;
grand_total = total + total * SALES_TAX;
if (grand_total <= 1000)
{
cout<<"Grand total is less than or equal to 1000 it is $";
printf("%.2f", grand_total);
}
else if (grand_total > 1000 && grand_total <= 2000 )
{
cout<<"Grand total is more than 1000 less than or equal to 2000 it is $";
printf("%.2f", grand_total);
}
else
{
cout<<"Grand total is greater than 2000 it is $";
printf("%.2f", grand_total);
}
cout<<"\nProgram finished!";
return 0;
}
Explanation:
<em>I've added the full source code as an attachment where I use comments to explain difficult lines</em>
Answer:
The output is:
aaa 3
Explanation:
Lets examine the code snippet
- public static void main(String[] args) {
- String[] arr = { "aaa", "bbb", "ccc" };
- mystery(arr);
- System.out.println(arr[0] + " " + arr.length);
- }
- public static void mystery(String[] arr) {
- arr = new String[5];
- arr[0] = "ddd";
- }
- }
Line 2 Creates an array with three string values
line 3 calls method mystery() The method definition on lines 6-9 indicates that it does not output any value, neither does it return any value
Line 4 determines the output of this code. In the output statement The first element of the array (indexed 0) is printed concatenated with the length of the array which is 3. Hence the output aaa 3
A proprietary database is a database that is privately owned and password protected. i hope this helps!!!! :)
because it's a good thing